From: Matthias Schmidt Date: Thu, 18 Dec 2008 10:56:46 +0000 (+0100) Subject: Fix annoying bug with grep and HAMMER X-Git-Tag: v2.3.0~227^2~2 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1f1aa8d7b840c4f625756edd033e90549a1e81f4 Fix annoying bug with grep and HAMMER grep foo * on an UFS partition was silent if grep hit a subdirectory. If executed on HAMMER, grep complains about "Invalid argument" because directories in HAMMER are not treated as files. Before: cd /usr/src grep test * Makefile: test \ grep: cat: Invalid argument [...] After: grep test * Makefile: test \ --- diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index 5266f2af86..2f505d4d26 100644 --- a/gnu/usr.bin/grep/grep.c +++ b/gnu/usr.bin/grep/grep.c @@ -752,8 +752,10 @@ grep (int fd, char const *file, struct stats *stats) if (! fillbuf (save, stats)) { - if (! (is_EISDIR (errno, file) && suppress_errors)) - error (filename, errno); + if (! (is_EISDIR (errno, file) && suppress_errors)) { + if (error == EINVAL) + error (filename, errno); + } return 0; }