From: Aleš Křenek Date: Tue, 14 Mar 2006 13:19:31 +0000 (+0000) Subject: glite_jppsbe_query(): return ENOENT rather then EIO when nothing is found X-Git-Tag: merge_for_3_1_after~22 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=f57ae6d76475167ca52cf26d7e749b22eee2b2c6;p=jra1mw.git glite_jppsbe_query(): return ENOENT rather then EIO when nothing is found --- 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) {