bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep-2.5.1: bug ?? --


From: Paul Townsend
Subject: grep-2.5.1: bug ?? --
Date: Wed, 9 Apr 2003 21:50:01 -0500 (EST)

=====
You are probably already aware of this but the code and the
documentation don't quite agree.  The documentation states

-D ACTION, --devices=ACTION
    If an input file is a device, FIFO or socket, use ACTION to process
    it.  By default, ACTION is read, which means that devices are read
    just as if they were ordinary files.  If ACTION is skip, devices are
    silently skipped.

Actually, the code in "src/grep.c" never checks for a FIFO at all.
Following is the patch that I use to correct the perceived problem.

I added a DOORs check although I'm not sure a DOOR would hang `grep' the
way a FIFO does.

I also know zip about DJGPP so the patch is incomplete.

--    Paul Townsend (address@hidden)

=-=-=-=-=-=
--- src/grep.c.orig     Tue Mar 26 10:54:12 2002
+++ src/grep.c  Wed Apr  9 21:38:35 2003
@@ -263,7 +263,14 @@
   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)))
+  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode)
+# if defined(S_ISFIFO)
+    || S_ISFIFO(stats->stat.st_mode)
+# endif
+# if defined(S_ISDOOR)
+    || S_ISDOOR(stats->stat.st_mode)
+# endif
+    || 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)))
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]