diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-08 15:02:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-08 15:02:54 +0000 |
commit | 299687341193ef2f4290c7f376f73f92c6948fbf (patch) | |
tree | d5e5662ebbcf3073497d5c5b03f8c97e031aebd6 /mansearch.c | |
parent | febef6ac411b15bf06ccd1f405d0af42e79d5e0e (diff) | |
download | mandoc-299687341193ef2f4290c7f376f73f92c6948fbf.tar.gz |
Prefer warn(3) over perror(3) at the few places where it was used.
It is useful to see the program name, and we have err.h compat in place anyway.
Suggested by Christos Zoulas (NetBSD).
Diffstat (limited to 'mansearch.c')
-rw-r--r-- | mansearch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mansearch.c b/mansearch.c index 0db8edbf..32a9aa96 100644 --- a/mansearch.c +++ b/mansearch.c @@ -125,7 +125,7 @@ mansearch_setup(int start) MAP_SHARED | MAP_ANON, -1, 0); if (MAP_FAILED == pagecache) { - perror("mmap"); + warn("mmap"); pagecache = NULL; return (int)MANDOCLEVEL_SYSERR; } @@ -144,7 +144,7 @@ mansearch_setup(int start) } if (-1 == munmap(pagecache, PC_PAGESIZE * PC_NUMPAGES)) { - perror("munmap"); + warn("munmap"); pagecache = NULL; return (int)MANDOCLEVEL_SYSERR; } @@ -226,12 +226,12 @@ mansearch(const struct mansearch *search, warnx("%s: getcwd: %s", paths->paths[i], buf); continue; } else if (chdir(buf) == -1) { - perror(buf); + warn("%s", buf); continue; } } if (chdir(paths->paths[i]) == -1) { - perror(paths->paths[i]); + warn("%s", paths->paths[i]); continue; } chdir_status = 1; @@ -364,7 +364,7 @@ mansearch(const struct mansearch *search, } qsort(*res, cur, sizeof(struct manpage), manpage_compare); if (chdir_status && getcwd_status && chdir(buf) == -1) - perror(buf); + warn("%s", buf); exprfree(e); free(sql); *sz = cur; |