aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
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
commitf2385224ad444de5011bb93e424f6f3f4dba6025 (patch)
tree98d74320b2c0a34ee4e1c211b8ed0b4ad9e97f64 /mandocdb.c
parent867b6a3e2cee7e47c2bc618c2862eb9344480afa (diff)
downloadmandoc-f2385224ad444de5011bb93e424f6f3f4dba6025.tar.gz
mandoc-f2385224ad444de5011bb93e424f6f3f4dba6025.tar.zst
mandoc-f2385224ad444de5011bb93e424f6f3f4dba6025.zip
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.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 15611ec9..09848f7d 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.229 2016/09/01 15:08:04 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.230 2016/09/02 14:03:30 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -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())