[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep --devices=skip does not ignore FIFOs (version 2.5.1a +FIX)
From: |
Ken Lalonde |
Subject: |
grep --devices=skip does not ignore FIFOs (version 2.5.1a +FIX) |
Date: |
Fri, 16 Jun 2006 12:03:21 -0400 |
User-agent: |
Mutt/1.4.2.1i |
Version 2.5.1a of gnu grep does not ignore FIFO files under the --devices=skip
option, as advertised in the man page.
Here's one way to fix that:
--- grep.c.orig Fri Jun 16 11:53:37 2006
+++ grep.c Fri Jun 16 11:55:56 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 && (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))
{
Cheers,
Ken Lalonde, Toronto Canada
- grep --devices=skip does not ignore FIFOs (version 2.5.1a +FIX),
Ken Lalonde <=