From 211bc3d356ccbbc2b1026015d32e21986f6a95b0 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 9 Jun 2011 12:45:42 +0300 Subject: [PATCH] Fix the non-keyed match iteration case wrt DB_NOTFOUND - This broke in commit 7e4415fcc5e11cfd4cd9d0dfe19568be73f15d74, the cases are not identical afterall: With non-keyed cursor retrievals DB_NOTFOUND is returned when there's nothing more to get, this is not an error situation. --- lib/rpmdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 613b8a4..e89fef9 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -1989,6 +1989,10 @@ rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag, rc = dbiCursorGetToSet(dbc, NULL, 0, &set); } while (rc == 0); + /* If we got some results, not found is not an error */ + if (rc == DB_NOTFOUND && set != NULL) + rc = 0; + dbiCursorFree(dbc); } -- 2.7.4