From: Miloš Mulač Date: Tue, 17 Oct 2006 07:55:17 +0000 (+0000) Subject: GetSemID added X-Git-Tag: mergeto_glite-lb-client_branch_2_3_0_0243_generic_23Nov06~10 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=5bd6545fdc1f4d067bbd20a55c91c8ecf7a1f869;p=jra1mw.git GetSemID added - needs audit! --- diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index 6037ecb..46a6b02 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -250,7 +250,7 @@ else PLUGIN_LIB=glite_lb_plugin.la endif -compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB} store.c +compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB} store.c index.c check: compile test.xml test.query diff --git a/org.glite.lb.server/src/lock.c b/org.glite.lb.server/src/lock.c index 6351846..b4cd987 100644 --- a/org.glite.lb.server/src/lock.c +++ b/org.glite.lb.server/src/lock.c @@ -11,19 +11,34 @@ extern int debug; -int edg_wll_LockUnlockJob(const edg_wll_Context ctx,const edg_wlc_JobId job,int lock) +int edg_wll_GetSemID(const edg_wll_Context ctx, const edg_wlc_JobId job) { - struct sembuf s; char *un = edg_wlc_JobIdGetUnique(job); int n,i; static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - - if (!un) return edg_wll_SetError(ctx,EINVAL,"jobid"); + + + if (!un) { + edg_wll_SetError(ctx,EINVAL,"jobid"); + return -1; + } for (n=0; nsemaphores,lock); s.sem_num = n % ctx->semaphores; diff --git a/org.glite.lb.server/src/lock.h b/org.glite.lb.server/src/lock.h index c67ec6d..85bb875 100644 --- a/org.glite.lb.server/src/lock.h +++ b/org.glite.lb.server/src/lock.h @@ -2,3 +2,4 @@ #define edg_wll_UnlockJob(ctx,job) edg_wll_LockUnlockJob((ctx),(job),1) int edg_wll_LockUnlockJob(const edg_wll_Context,const edg_wlc_JobId,int); +int edg_wll_GetSemID(const edg_wll_Context ctx, const edg_wlc_JobId job);