diff options
author | gabor <gabor@FreeBSD.org> | 2011-11-28 20:04:26 +0000 |
---|---|---|
committer | gabor <gabor@FreeBSD.org> | 2011-11-28 20:04:26 +0000 |
commit | 8202ac2d5fc44ca18146bf83215d0d81e19f3601 (patch) | |
tree | 229b22cde08b6fedb02d057c462eb03e633e23eb | |
parent | 7b8d844d3a215213a277d9a84b016fda9fcdc3ea (diff) | |
download | FreeBSD-src-8202ac2d5fc44ca18146bf83215d0d81e19f3601.zip FreeBSD-src-8202ac2d5fc44ca18146bf83215d0d81e19f3601.tar.gz |
- 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 <jbeich@tormail.net>
MFC after: 3 days
-rw-r--r-- | usr.bin/grep/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 */ |