summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2021-03-15 13:29:19 +0200
committerPanu Matilainen <pmatilai@redhat.com>2021-03-22 12:04:27 +0200
commit9c5b2669c877f6de08bd81af02f859fb93d52d42 (patch)
treeb4c506681d48039ab8e5061eade3c91529a0059a
parent8af1e41a09556fcebad14ddb6504628f79654d35 (diff)
downloadrpm-9c5b2669c877f6de08bd81af02f859fb93d52d42.tar.gz
Fix bdb_ro index open error handling
open() returns -1 on error, not 0, so this wasn't catching what it was supposed to. Drop the error message as this case is better handled in the caller. (cherry picked from commit 632b7a30fd4ad7499d194ef768c30024d51349c5)
-rw-r--r--lib/backend/bdb_ro.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/backend/bdb_ro.c b/lib/backend/bdb_ro.c
index 74569cb03..222e25600 100644
--- a/lib/backend/bdb_ro.c
+++ b/lib/backend/bdb_ro.c
@@ -160,8 +160,7 @@ static struct bdb_db *bdb_open(const char *name)
struct bdb_db *db;
fd = open(name, O_RDONLY);
- if (!fd) {
- rpmlog(RPMLOG_ERR, "%s: %s\n", name, strerror(errno));
+ if (fd == -1) {
return NULL;
}
db = xcalloc(1, sizeof(*db));