diff options
author | Colin Watson <cjwatson@debian.org> | 2022-10-18 00:36:49 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-10-18 00:36:49 +0100 |
commit | 20f048d1b4303158f61d7e88330f6c5b53a82b81 (patch) | |
tree | 15ac223ed78341682e9fe54e02b4fc4843f9008c /src | |
parent | 71aefedddd2c1156c5cea8ebd27debc4e23b458a (diff) |
Silence error for empty mandir with missing catdir
Fixes https://gitlab.com/cjwatson/man-db/-/issues/8.
* src/check_mandirs.c (ensure_db_open): Don't call `gripe_rwopen_failed`
before returning false (since it only makes sense for one of the two
callers).
(testmandirs): Call `gripe_rwopen_failed` if `ensure_db_open` returns
false.
Diffstat (limited to 'src')
-rw-r--r-- | src/check_mandirs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/check_mandirs.c b/src/check_mandirs.c index 8ed87d7f..75c6f5e2 100644 --- a/src/check_mandirs.c +++ b/src/check_mandirs.c @@ -141,10 +141,8 @@ static bool ensure_db_open (MYDBM_FILE dbf) { if (dbf->file) return true; - if (!MYDBM_RWOPEN (dbf)) { - gripe_rwopen_failed (dbf); + if (!MYDBM_RWOPEN (dbf)) return false; - } return true; } @@ -558,6 +556,7 @@ static int testmandirs (MYDBM_FILE dbf, const char *path, const char *catpath, created = true; } else if (!ensure_db_open (dbf)) { + gripe_rwopen_failed (dbf); closedir (dir); return 0; } |