diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-09-02 14:03:25 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-09-02 14:03:25 +0000 |
commit | 1dd6d3dc7bceeefa5b543cc5032441586107206f (patch) | |
tree | 0ff3fd02645b99eae7339cca47f7b7de11bf808a /usr.bin/mandoc | |
parent | b0ca0a43da43229e0470a9bd59ccccfb8bfd30c3 (diff) |
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 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/mandocdb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c index 4183d71dbec..024377bf7e3 100644 --- a/usr.bin/mandoc/mandocdb.c +++ b/usr.bin/mandoc/mandocdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandocdb.c,v 1.178 2016/09/01 15:07:46 schwarze Exp $ */ +/* $OpenBSD: mandocdb.c,v 1.179 2016/09/02 14:03:24 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2016 Ingo Schwarze <schwarze@openbsd.org> @@ -425,9 +425,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()) |