summaryrefslogtreecommitdiffstats
path: root/mansearch.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-06 01:23:24 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-06 01:23:24 +0000
commit4ba2b2cc08b4390ee3d0fb53289b92b30a5d9a77 (patch)
tree320846d1e71964a5c115bd05042017dd83334d3d /mansearch.c
parent1c23090f08a7aeaf5a36d9b14dd73f1671924b41 (diff)
downloadmandoc-4ba2b2cc08b4390ee3d0fb53289b92b30a5d9a77.tar.gz
When opening mandoc.db fails, tell the user in which directory.
Improving an unhelpful error message reported by millert@.
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mansearch.c b/mansearch.c
index 89749151..75b340bf 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
@@ -246,7 +247,8 @@ mansearch(const struct mansearch *search,
SQLITE_OPEN_READONLY, NULL);
if (SQLITE_OK != c) {
- perror(MANDOC_DB);
+ fprintf(stderr, "%s/%s: %s\n",
+ paths->paths[i], MANDOC_DB, strerror(errno));
sqlite3_close(db);
continue;
}