From: Michal Voců Date: Wed, 7 Jun 2006 19:32:39 +0000 (+0000) Subject: * make producer function return jobid string X-Git-Tag: gridsite-core_R_1_3_1~17 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=c98ab7b738a82f2897834579b16ea59a6f3ec8a5;p=jra1mw.git * make producer function return jobid string --- diff --git a/org.glite.lb.common/interface/lb_perftest.h b/org.glite.lb.common/interface/lb_perftest.h index 398938c..206fc25 100644 --- a/org.glite.lb.common/interface/lb_perftest.h +++ b/org.glite.lb.common/interface/lb_perftest.h @@ -20,7 +20,7 @@ glite_wll_perftest_init(const char *host, /** hostname */ char * glite_wll_perftest_produceJobId(); -int +const char * glite_wll_perftest_produceEventString(char **event); int diff --git a/org.glite.lb.common/src/lb_perftest.c b/org.glite.lb.common/src/lb_perftest.c index 57c4f58..da1f84e 100644 --- a/org.glite.lb.common/src/lb_perftest.c +++ b/org.glite.lb.common/src/lb_perftest.c @@ -288,7 +288,7 @@ glite_wll_perftest_produceJobId() * For every nevents (one job) new jobid is generated and inserted into * event. The last event is termination - usertag. */ -int +const char * glite_wll_perftest_produceEventString(char **event) { static char *cur_jobid = NULL; @@ -303,7 +303,7 @@ glite_wll_perftest_produceEventString(char **event) if(cur_job < 0) { if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(0); + return(NULL); } /* did we send all jobs? */ @@ -325,7 +325,7 @@ glite_wll_perftest_produceEventString(char **event) fprintf(stderr, "produceEventString: error creating termination event\n"); if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(-1); + return(NULL); } /* and refuse to produce more */ @@ -360,13 +360,13 @@ glite_wll_perftest_produceEventString(char **event) fprintf(stderr, "produceEventString: error creating jobid\n"); if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(-1); + return(NULL); } if((cur_jobid=edg_wlc_JobIdUnparse(jobid)) == NULL) { fprintf(stderr, "produceEventString: error unparsing jobid\n"); if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(-1); + return(NULL); } } @@ -375,7 +375,7 @@ glite_wll_perftest_produceEventString(char **event) fprintf(stderr, "produceEventString: error generating event\n"); if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(-1); + return(NULL); } } @@ -390,7 +390,7 @@ glite_wll_perftest_produceEventString(char **event) if(pthread_mutex_unlock(&perftest_lock) < 0) abort(); - return(strlen(e)); + return(cur_jobid); }