From: Zdeněk Salvet Date: Wed, 9 Nov 2005 09:59:52 +0000 (+0000) Subject: Don't store SRC_INSTANCE in store_flesh() if some error already occured. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=814b256ad34078c9eba3f6ec8c71b78b2c051a46;p=jra1mw.git Don't store SRC_INSTANCE in store_flesh() if some error already occured. Avoids useless work and, more importantly, preserves description of the previous error in context. --- diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index 6ce17fb..3754cb2 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -333,11 +333,13 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,char *jobid,int no) for (i=0; iany.src_instance); - if (edg_wll_ExecStmt(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); - free(stmt); + if (!err) { + trio_asprintf(&stmt,"insert into short_fields(jobid,event,name,value) " + "values ('%|Ss',%d,'SRC_INSTANCE','%|Ss')", + jobid,no,e->any.src_instance); + if (edg_wll_ExecStmt(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); + free(stmt); + } return err; }