initialise the intStatus in plugin correctly
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 16 Sep 2005 12:16:36 +0000 (12:16 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 16 Sep 2005 12:16:36 +0000 (12:16 +0000)
org.glite.lb.server/src/jobstat.c
org.glite.lb.server/src/jobstat.h
org.glite.lb.server/src/jobstat_supp.c
org.glite.lb.server/src/lb_plugin.c

index 9846fe6..a1f27ae 100644 (file)
@@ -47,17 +47,6 @@ int js_enable_store = 1;
  * Basic manipulations with the internal representation of job state
  */
 
-static void init_intJobStat(intJobStat *p)
-{
-       memset(p, 0, sizeof(intJobStat));
-       p->pub.jobtype = EDG_WLL_STAT_SIMPLE;
-       p->pub.children_hist = (int*) calloc(1+EDG_WLL_NUMBER_OF_STATCODES, sizeof(int));
-       p->pub.children_hist[0] = EDG_WLL_NUMBER_OF_STATCODES;
-       p->pub.stateEnterTimes = (int*) calloc(1+EDG_WLL_NUMBER_OF_STATCODES, sizeof(int));
-       p->pub.stateEnterTimes[0] = EDG_WLL_NUMBER_OF_STATCODES;
-       /* TBD: generate */
-}
-
 #if 0
 static int eval_expect_update(intJobStat *, int *, char **);
 #endif
index 7460523..181a85d 100644 (file)
@@ -69,3 +69,4 @@ int processEvent(intJobStat *, edg_wll_Event *, int, int, char **);
 int add_stringlist(char ***, const char *);
 int edg_wll_compare_seq(const char *, const char *);
 
+void init_intJobStat(intJobStat *p);
index 84a9cc3..58d4a51 100644 (file)
@@ -739,3 +739,16 @@ void edg_wll_SortEvents(edg_wll_Event *e)
        for (n=0; e[n].type; n++);
        qsort(e,n,sizeof *e,compare_events_by_seq);
 }
+
+
+void init_intJobStat(intJobStat *p)
+{
+       memset(p, 0, sizeof(intJobStat));
+       p->pub.jobtype = EDG_WLL_STAT_SIMPLE;
+       p->pub.children_hist = (int*) calloc(1+EDG_WLL_NUMBER_OF_STATCODES, sizeof(int));
+       p->pub.children_hist[0] = EDG_WLL_NUMBER_OF_STATCODES;
+       p->pub.stateEnterTimes = (int*) calloc(1+EDG_WLL_NUMBER_OF_STATCODES, sizeof(int));
+       p->pub.stateEnterTimes[0] = EDG_WLL_NUMBER_OF_STATCODES;
+       /* TBD: generate */
+}
+
index 7c2db6d..340478c 100644 (file)
@@ -377,6 +377,7 @@ static int lb_status(edg_wll_Event **events, edg_wll_JobStat *status) {
        char            *errstring;
         
         js = calloc(1, sizeof(intJobStat));
+       init_intJobStat(js);
         
        i = 0;
         while (events[i])