From d783165fc3c7e0ee32df7337e322199711955813 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 21 Oct 2009 08:50:25 +0200 Subject: Simplified and made the get_destination_path() function more robust Also added missing error check of the result of the function call --- server/parser/pgsql.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/parser/pgsql.c') diff --git a/server/parser/pgsql.c b/server/parser/pgsql.c index 1ff34ad..563687c 100644 --- a/server/parser/pgsql.c +++ b/server/parser/pgsql.c @@ -400,7 +400,7 @@ parseJob_t *db_get_submissionqueue_job(dbconn *dbc, pthread_mutex_t *mtx) { // Get the first available submission memset(&sql, 0, 4098); snprintf(sql, 4096, - "SELECT submid, filename" + "SELECT submid, filename, clientid" " FROM submissionqueue" " WHERE status = %i" " ORDER BY submid" @@ -420,7 +420,8 @@ parseJob_t *db_get_submissionqueue_job(dbconn *dbc, pthread_mutex_t *mtx) { if( PQntuples(res) == 1 ) { job->status = jbAVAIL; job->submid = atoi_nullsafe(PQgetvalue(res, 0, 0)); - snprintf(job->filename, 4090, "%.4090s", PQgetvalue(res, 0, 1)); + snprintf(job->filename, 4095, "%.4094s", PQgetvalue(res, 0, 1)); + snprintf(job->clientid, 255, "%.254s", PQgetvalue(res, 0, 2)); // Update the submission queue status if( db_update_submissionqueue(dbc, job->submid, STAT_ASSIGNED) < 1 ) { -- cgit