From e955b4aec31eaa0a6a1ded166c41d55bdb893a87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 16 Mar 2006 16:29:20 +0000 Subject: [PATCH] use "unique" part of jobid only --- org.glite.jp.primary/src/new_ftp_backend.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/org.glite.jp.primary/src/new_ftp_backend.c b/org.glite.jp.primary/src/new_ftp_backend.c index 99ac0f4..5b32915 100644 --- a/org.glite.jp.primary/src/new_ftp_backend.c +++ b/org.glite.jp.primary/src/new_ftp_backend.c @@ -2023,13 +2023,16 @@ int glite_jppsbe_set_fed( const char *job ) { - char *stmt = NULL; - int rows; + char *stmt = NULL,*u = NULL; + int rows,ret; glite_jp_error_t err; memset(&err,0,sizeof err); + if ((ret = jobid_unique_pathname(ctx,job,&u,NULL,0))) return ret; + trio_asprintf(&stmt,"insert into fed_jobs(feedid,jobid) " - "values ('%|Ss','%|Ss')", feed,job); + "values ('%|Ss','%|Ss')", feed,u); + free(u); if ((rows = glite_jp_db_execstmt(ctx,stmt,NULL)) < 0) { err.source = __FUNCTION__; @@ -2060,13 +2063,18 @@ int glite_jppsbe_check_fed( int *result ) { - char *stmt = NULL; - int rows; + char *stmt = NULL,*u = NULL; + int rows,ret; glite_jp_error_t err; memset(&err,0,sizeof err); + + if ((ret = jobid_unique_pathname(ctx,job,&u,NULL,0))) return ret; + trio_asprintf(&stmt,"select 'x' from fed_jobs " "where jobid = '%|Ss' and feedid = '%|Ss'", - job,feed); + u,feed); + + free(u); if ((rows = glite_jp_db_execstmt(ctx,stmt,NULL)) < 0) { err.source = __FUNCTION__; -- 1.8.2.3