job_status working
authorMiloš Mulač <mulac@civ.zcu.cz>
Mon, 25 Feb 2008 12:47:33 +0000 (12:47 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Mon, 25 Feb 2008 12:47:33 +0000 (12:47 +0000)
- proper initialization
- typo in SQL syntax

org.glite.lb.server/src/db_calls.c
org.glite.lb.server/src/jobstat.c

index 970ce55..bc86fef 100644 (file)
@@ -56,7 +56,7 @@ clean:
 
 
 /* just lock one row corresponding to job in table jobs
- * lock_mode: 0 = in share mode / 1 = for update
+ * lock_mode: 0 = lock in share mode / 1 = for update
  */
 int edg_wll_LockJobRow(edg_wll_Context ctx, glite_jobid_const_t job, int lock_mode) 
 {
@@ -72,7 +72,7 @@ int edg_wll_LockJobRow(edg_wll_Context ctx, glite_jobid_const_t job, int lock_mo
        if (lock_mode) 
                trio_asprintf(&stmt, "select count(*) from jobs where jobid='%|Ss' for update", jobid_md5);
        else
-               trio_asprintf(&stmt, "select count(*) from jobs where jobid='%|Ss' in share mode", jobid_md5);
+               trio_asprintf(&stmt, "select count(*) from jobs where jobid='%|Ss' lock in share mode", jobid_md5);
 
        if ((nr = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup;
        if (nr == 0) {
index 39bc568..41add31 100644 (file)
@@ -97,7 +97,7 @@ int edg_wll_JobStatusServer(
 
        edg_wll_ResetError(ctx);
 
-       jobstat.pub.owner = NULL;       
+       memset(&jobstat, 0, sizeof(jobstat));
        string_jobid = edg_wlc_JobIdUnparse(job);
        if (string_jobid == NULL || stat == NULL)
                return edg_wll_SetError(ctx,EINVAL, NULL);