* added -n option to send multiple events (on branch)
authorMichal Voců <michal@ruk.cuni.cz>
Mon, 6 Mar 2006 13:10:41 +0000 (13:10 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Mon, 6 Mar 2006 13:10:41 +0000 (13:10 +0000)
org.glite.lb.client/src/logevent.c.T

index b939e05..1c2efa1 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
        char    *ff = NULL, *jobid_s = NULL;
        char    *src_instance = NULL;
        int     err = 0/*,i,done = 0,fmtlen*/;
-       int     pri = 0, noinc = 0;
+       int     pri = 0, noinc = 0, ncopies = 1;
        int             use_lbproxy = 0;
        char    *lbproxy_user = NULL;
        char    *lbproxy_store_sock = NULL;
@@ -92,6 +92,7 @@ int main(int argc, char *argv[])
 #ifdef ENABLE_REASON_LENGTH
            { EDG_WLL_ARGS_INT, "l", "reason-length", "extend 'reason' string to length (debug only)", &elength, 0, 1000000000 },
            { EDG_WLL_ARGS_BOOL, "I", "dont-increment", "don't increment initial seqence code", &noinc },
+           { EDG_WLL_ARGS_INT, "n", "number", "send the event n-times", &ncopies },
 #endif
 @@@{
     my %typetab = (
@@ -264,7 +265,7 @@ $indent = "\t";
            $argl = $argl . $fn;
        }
 gen qq{\t    //edg_wll_Log$t();
-\t    err |= logev(ctx, EDG_WLL_EVENT_$tu, EDG_WLL_FORMAT_${tu}$argl);
+\t    while(ncopies-- > 0) err |= logev(ctx, EDG_WLL_EVENT_$tu, EDG_WLL_FORMAT_${tu}$argl);
 \t    break;
 };
     }