Further to my previous message:
The patch I included is incorrect: when --devices=skip is specified,
the patch will cause "grep ... <data" to fail, since stdin is a FIFO.
Here's a corrected version:
--- grep.c.orig Fri Jun 16 11:53:37 2006
+++ grep.c Fri Jun 16 12:18:12 2006
@@ -262,11 +262,13 @@
}
if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
return 0;
-#ifndef DJGPP
- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) ||
S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
-#else
- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) ||
S_ISBLK(stats->stat.st_mode)))
+#ifndef S_ISFIFO
+# define S_ISFIFO(m) 0
#endif
+#ifndef S_ISSOCK
+# define S_ISSOCK(m) 0
+#endif
+ if (devices == SKIP_DEVICES && file && (S_ISCHR(stats->stat.st_mode) ||
S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) ||
S_ISFIFO(stats->stat.st_mode)))
return 0;
if (S_ISREG (stats->stat.st_mode))
{