-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/netmem.c,v 6.26 2003-05-14 13:54:44 muench Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/netmem.c,v 6.27 2004-08-13 08:55:38 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
unsigned long priority;
unsigned long queueSize;
char verbosity[PARAM_MAX_VALUE_LEN];
-}
-
-TheArgs;
+} TheArgs;
static jmp_buf terminateJmp;
{
extern char *optarg;
int i;
+ int inPathCntFromParam;
+
+ /* inPath must _overwrite_, not add to param */
+ inPathCntFromParam = my->inPathCnt;
+ my->inPathCnt = 0;
while ((i = getopt(argc, argv, "ai:m:q:p:v:")) != -1) {
switch (i) {
break;
}
}
+
+ /* restore inPathCnt only if it ws not touched here */
+ if (my->inPathCnt == 0) {
+ my->inPathCnt = inPathCntFromParam;
+ }
+
return 0;
}
int paramWasFound;
conSetupParam(param, getenv("DAQ_SETUP"));
- Param_getStringArray(param, argv[0], "inpath",
- MAXINPATH, &my->inPathCnt, my->inPath);
+ Param_getStringArray(param, argv[0], "inpath", MAXINPATH, &my->inPathCnt, my->inPath);
Param_getInt(param, argv[0], "nrofmsgs", ¶mWasFound, &my->nrOfMsgs);
Param_getInt(param, argv[0], "stndln", ¶mWasFound, &my->isStandalone);
Param_getInt(param, argv[0], "prio", ¶mWasFound, &my->priority);
int i;
- if (theArgs->isStandalone
- && strcmp(theArgs->verbosity, "info") == 0
- && (dT = (time(NULL) - lastTime)) >= interval
- ) {
+ if (theArgs->isStandalone && strcmp(theArgs->verbosity, "info") == 0 && (dT = (time(NULL) - lastTime)) >= interval) {
fputs("==============================================================================\n", stderr);
for (i = 0; i < theArgs->nrOfMsgs; i++) {
- fprintf(stderr, "%17s%02d:%6s",
- "pktsReceived", i, unit(*my[i]->pktsReceived));
- fprintf(stderr, "%17s%02d:%6s",
- "pktsDiscarded", i, unit(*my[i]->pktsDiscarded));
- fprintf(stderr, "%15s%02d :%6s",
- "bytesReceived", i, unit(*my[i]->bytesReceived));
+ fprintf(stderr, "%17s%02d:%6s", "pktsReceived", i, unit(*my[i]->pktsReceived));
+ fprintf(stderr, "%17s%02d:%6s", "pktsDiscarded", i, unit(*my[i]->pktsDiscarded));
+ fprintf(stderr, "%15s%02d :%6s", "bytesReceived", i, unit(*my[i]->bytesReceived));
fputc('\n', stderr);
- fprintf(stderr, "%17s%02d:%6s",
- "msgsReceived", i, unit(*my[i]->msgsReceived));
- fprintf(stderr, "%17s%02d:%6s",
- "msgsDiscarded", i, unit(*my[i]->msgsDiscarded));
- fprintf(stderr, "%15s%02d/s:%6s",
- "bytesReceived", i, unit(*my[i]->bytesReceived - lastBR[i]));
+ fprintf(stderr, "%17s%02d:%6s", "msgsReceived", i, unit(*my[i]->msgsReceived));
+ fprintf(stderr, "%17s%02d:%6s", "msgsDiscarded", i, unit(*my[i]->msgsDiscarded));
+ fprintf(stderr, "%15s%02d/s:%6s", "bytesReceived", i, unit(*my[i]->bytesReceived - lastBR[i]));
lastBR[i] = *my[i]->bytesReceived;
fputc('\n', stderr);
fputs("------------------------------------------------------------------------------\n", stderr);
usage(argv[0]);
exit(EXIT_FAILURE);
}
- for (i = 0; prioritynames[i].c_name != NULL
- && 0 != strcmp(prioritynames[i].c_name, theArgs->verbosity); i++) {
+ for (i = 0; prioritynames[i].c_name != NULL && 0 != strcmp(prioritynames[i].c_name, theArgs->verbosity); i++) {
}
if (prioritynames[i].c_name == NULL) {
exit(EXIT_FAILURE);