From a70cca45132b6b01b27b341aa480d1b51bec2f96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 8 Sep 2005 17:02:17 +0000 Subject: [PATCH] glite_jppsbe_get_names() - typo "comitted" - select on internal vs. dg jobid - do allocate memory for output --- org.glite.jp.primary/src/new_ftp_backend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.glite.jp.primary/src/new_ftp_backend.c b/org.glite.jp.primary/src/new_ftp_backend.c index 0dace84..259b526 100644 --- a/org.glite.jp.primary/src/new_ftp_backend.c +++ b/org.glite.jp.primary/src/new_ftp_backend.c @@ -1801,8 +1801,8 @@ int glite_jppsbe_get_names( memset(&err,0,sizeof err); err.source = __FUNCTION__; - trio_asprintf(&qry,"select filename from files " - "where jobid = '%|Ss' and state = 'comitted'",job); + trio_asprintf(&qry,"select filename from files f,jobs j " + "where j.dg_jobid = '%|Ss' and j.jobid = f.jobid and f.state = 'committed'",job); if ((rows = glite_jp_db_execstmt(ctx,qry,&s)) <= 0) { if (rows == 0) { @@ -1829,6 +1829,7 @@ int glite_jppsbe_get_names( dot = strchr(file,'.'); /* XXX: can class contain dot? */ if (dot) *dot = 0; + out = realloc(out,(nout+1) * sizeof *out); if (!strcmp(file,class)) out[nout++] = dot ? dot+1 : NULL; free(file); -- 1.8.2.3