diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2021-03-15 13:29:19 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2021-03-22 12:04:27 +0200 |
commit | 9c5b2669c877f6de08bd81af02f859fb93d52d42 (patch) | |
tree | b4c506681d48039ab8e5061eade3c91529a0059a | |
parent | 8af1e41a09556fcebad14ddb6504628f79654d35 (diff) | |
download | rpm-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.c | 3 |
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)); |