From: Aleš Křenek Date: Thu, 8 Sep 2005 17:02:17 +0000 (+0000) Subject: glite_jppsbe_get_names() X-Git-Tag: gridsite-core_R_1_1_11~19 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=a70cca45132b6b01b27b341aa480d1b51bec2f96;p=jra1mw.git glite_jppsbe_get_names() - typo "comitted" - select on internal vs. dg jobid - do allocate memory for output --- 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);