diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-12-06 01:22:29 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-12-06 01:22:29 +0000 |
commit | d5d6ba8b07b9259a295bc65d1fd557a9e9bf82b9 (patch) | |
tree | 6346c6a0039f267c625fc5298523e520f334dc44 /usr.bin | |
parent | 20703d466ee2e12d26d2ad0c75e28b8465b693ed (diff) |
When opening mandoc.db fails, tell the user in which directory.
Improving an unhelpful error message reported by millert@.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mansearch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c index 1e45f016004..bc052b3e5e9 100644 --- a/usr.bin/mandoc/mansearch.c +++ b/usr.bin/mandoc/mansearch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mansearch.c,v 1.38 2014/11/27 01:57:42 schwarze Exp $ */ +/* $OpenBSD: mansearch.c,v 1.39 2014/12/06 01:22:28 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -20,6 +20,7 @@ #include <sys/types.h> #include <assert.h> +#include <errno.h> #include <fcntl.h> #include <getopt.h> #include <limits.h> @@ -238,7 +239,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; } |