From d5d6ba8b07b9259a295bc65d1fd557a9e9bf82b9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 6 Dec 2014 01:22:29 +0000 Subject: When opening mandoc.db fails, tell the user in which directory. Improving an unhelpful error message reported by millert@. --- usr.bin/mandoc/mansearch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 * Copyright (c) 2013, 2014 Ingo Schwarze @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -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; } -- cgit v1.2.3