diff options
| author | David Sommerseth <davids@redhat.com> | 2009-10-21 08:50:25 +0200 |
|---|---|---|
| committer | David Sommerseth <davids@redhat.com> | 2009-10-21 08:50:25 +0200 |
| commit | d783165fc3c7e0ee32df7337e322199711955813 (patch) | |
| tree | 3432e4cb7db0b66e41feef1227b39fbe805779d8 /server/parser/pgsql.c | |
| parent | 2584a3c36c97c757dc80108b898eede52b91dc44 (diff) | |
| download | rteval-d783165fc3c7e0ee32df7337e322199711955813.tar.gz rteval-d783165fc3c7e0ee32df7337e322199711955813.tar.xz rteval-d783165fc3c7e0ee32df7337e322199711955813.zip | |
Simplified and made the get_destination_path() function more robust
Also added missing error check of the result of the function call
Diffstat (limited to 'server/parser/pgsql.c')
| -rw-r--r-- | server/parser/pgsql.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 ) { |
