-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.122 2010-07-19 14:31:30 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.123 2010-07-23 13:45:02 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#define SYSLOG_NAMES
my->multiDisks = 1;
break;
case 'z': /* from MBytes to Bytes */
- my->maxFileSz = (1024 * 1024UL * strtoul(optarg, NULL, 0));
+ my->maxFileSz = (strtoul(optarg, NULL, 0) * 1024 * 1024UL - 1);
break;
case 'e': /* need resnumevents & respath */
my->resdownscale = strtoul(optarg, NULL, 0);
*/
/* check my->maxFileSz */
- if ((strcmp(my->outDev, "null") != 0) && (my->maxFileSz <= 0 || my->maxFileSz >= 1024 * 1024UL * 2000)) {
+ if ((strcmp(my->outDev, "null") != 0) && (my->maxFileSz <= 0 || my->maxFileSz >= 2 * 1024 * 1024 * 1024UL)) {
fprintf(stderr, "<E> evtbuild.c, argsCheck(): --filesize must be >0MB and <2000MB\n");
return 1;
}
* Something went wrong with sinchronization of Event Builders,
* close the file.
*/
- if ((!(theArgs->epicsCtrl) && (*theStats->bytesWritten) >= ((theArgs->maxFileSz) - (theArgs->queueSize[0]))) ||
+ if ((!(theArgs->epicsCtrl) && (*theStats->bytesWritten) >= theArgs->maxFileSz) ||
(theArgs->epicsCtrl && runNr < newRunId) ||
(theArgs->epicsCtrl && (*theStats->bytesWritten) >= 1900000000) || (theArgs->epicsCtrl && newRunId == 0)) {
evt = newEvt(EvtDecoding_64bitAligned, EvtId_runStop);