From 546a450c4d875aaf3548b7c6d7b69c4535b04a94 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 27 Jan 2010 17:27:59 +0000 Subject: [PATCH] few corrections for online service. Sergey. --- hadaq/evtbuild.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index ec18322..2f0b9e7 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.98 2010-01-27 17:10:34 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.99 2010-01-27 17:27:59 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L #define SYSLOG_NAMES @@ -178,7 +178,7 @@ static void usage(const char *progName) syslog(LOG_ERR, "Usage: [--shmname shmem_name] extension of shared memory name to be opened"); syslog(LOG_ERR, "Usage: [-a (agent)] [-p priority] [-I evtId]"); syslog(LOG_ERR, "Usage: [-v debug|info|notice|warning|err|alert|crit|emerg]"); - syslog(LOG_ERR, "Usage: [--online 0|1] online service: 0=off, 1=on (default off)"); + syslog(LOG_ERR, "Usage: [--online] switch on online service (default off)"); syslog(LOG_ERR, "Usage: [--filesize max_size] maximum size of output file in MB"); syslog(LOG_ERR, "Usage: [--resdownscale downscale_factor] downscale factor for the res events"); syslog(LOG_ERR, "Usage: [--resnumevents evt_num] maximum number of events in a resfile"); @@ -297,7 +297,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) int option_index = 0; static struct option long_options[] = { - {"online", 1, 0, 't'}, + {"online", 0, 0, 't'}, {"filesize", 1, 0, 'z'}, {"resdownscale", 1, 0, 'e'}, {"resnumevents", 1, 0, 'n'}, @@ -317,7 +317,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) {"ignore", 0, 0, 'i'}, {0, 0, 0, 0} }; - i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:t:z:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:i", long_options, &option_index); + i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:i", long_options, &option_index); if (i == -1) break; switch (i) { @@ -352,7 +352,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) my->evtId = strtoul(optarg, NULL, 0); break; case 't': /* online: 0=off, 1=on */ - my->online = strtoul(optarg, NULL, 0); + my->online = 1; break; case 'z': /* from MBytes to Bytes */ my->maxFileSz = (1024 * 1024UL * strtoul(optarg, NULL, 0)); @@ -1780,7 +1780,8 @@ int main(int argc, char *argv[]) writeRESFile(evt); } } - Evt_online(evt); + if (my->online) + Evt_online(evt); } else { (*theStats->evtsDiscarded)++; #if CHECK_MISMATCH @@ -1879,7 +1880,8 @@ int main(int argc, char *argv[]) for (i = 0; i < theArgs->nrOfMsgs; i++) ShmTrans_remove(shmTrans[i]); - finiOnline(); + if (my->online) + finiOnline(); Worker_fini(worker); exit(EXIT_SUCCESS); } -- 2.43.0