From 8202ac2d5fc44ca18146bf83215d0d81e19f3601 Mon Sep 17 00:00:00 2001 From: gabor Date: Mon, 28 Nov 2011 20:04:26 +0000 Subject: - Call warnx() instead of errx() if a directory is not readable when using a recursive search. This is the expected behavior instead of aborting. PR: bin/162907 Submitted by: Jan Beich MFC after: 3 days --- usr.bin/grep/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index 447e8c5..75ed107 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -130,7 +130,9 @@ grep_tree(char **argv) case FTS_DNR: /* FALLTHROUGH */ case FTS_ERR: - errx(2, "%s: %s", p->fts_path, strerror(p->fts_errno)); + notfound = true; + if(!sflag) + warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); break; case FTS_D: /* FALLTHROUGH */ -- cgit v1.1