From f57ae6d76475167ca52cf26d7e749b22eee2b2c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 14 Mar 2006 13:19:31 +0000 Subject: [PATCH] glite_jppsbe_query(): return ENOENT rather then EIO when nothing is found --- org.glite.jp.primary/src/new_ftp_backend.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.glite.jp.primary/src/new_ftp_backend.c b/org.glite.jp.primary/src/new_ftp_backend.c index 75210ca..fe1dd2e 100644 --- a/org.glite.jp.primary/src/new_ftp_backend.c +++ b/org.glite.jp.primary/src/new_ftp_backend.c @@ -1874,12 +1874,18 @@ int glite_jppsbe_query( where, cmask & 1 ? "and u.userid = j.owner" : ""); - if (glite_jp_db_execstmt(ctx,stmt,&q) <= 0) { + if ((ret = glite_jp_db_execstmt(ctx,stmt,&q)) < 0) { err.code = EIO; err.desc = "DB call fail"; glite_jp_stack_error(ctx,&err); goto cleanup; } + else if (ret == 0) { + err.code = ENOENT; + err.desc = "no matching jobs"; + glite_jp_stack_error(ctx,&err); + goto cleanup; + } while ((ret = glite_jp_db_fetchrow(q,qres)) > 0) { if (cmask & 1) { -- 1.8.2.3