summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-09-02 14:03:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-09-02 14:03:30 +0000
commit287b10ca057f74e3816bb43d947b7498629f1459 (patch)
tree1a06aaef4514f7987eda2c569af0a09b470645b5
parentfa9e887ca5bac200e7f3b9d1802cafffbc71d3b9 (diff)
downloadmandoc-287b10ca057f74e3816bb43d947b7498629f1459.tar.gz
When "makewhatis -d" tries to add to a database that doesn't (yet) exist,
silently create it from scratch instead of printing a warning. The annoying warning message was reported by ajacoutot@, and espie@ convincingly argues that a non-existing database can be considered equivalent to an empty one.
-rw-r--r--mandocdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mandocdb.c b/mandocdb.c
index fab09b0d..60eadc11 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -449,9 +449,9 @@ mandocdb(int argc, char *argv[])
dbprune(dba);
} else {
/* Database missing or corrupt. */
- say(MANDOC_DB,
- "%s: Automatically recreating from scratch",
- strerror(errno));
+ if (op != OP_UPDATE || errno != ENOENT)
+ say(MANDOC_DB, "%s: Automatically recreating"
+ " from scratch", strerror(errno));
exitcode = (int)MANDOCLEVEL_OK;
op = OP_DEFAULT;
if (0 == treescan())