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

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

grep: S_ISSOCK not POSIX


From: Ilya N. Golubev
Subject: grep: S_ISSOCK not POSIX
Date: Mon, 31 May 2004 18:48:32 +0400

Without the patch below `grep' fails to compile for just about any
non-GNU system.

        * (reset): `S_ISSOCK' is GNU extension of libc.  Systems not
        having it do not have to be based on DJGPP.  Avoid lossage
        when it is not present in a generic fashion.

--- grep.c      2004/05/31 14:03:26     1.1
+++ grep.c      2004/05/31 14:45:38     1.2
@@ -262,11 +262,10 @@
     }
   if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
     return 0;
-#ifndef DJGPP
+# ifndef S_ISSOCK
+#   define S_ISSOCK(m) 0
+# endif /* ndef S_ISSOCK */
   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)))
-#endif
     return 0;
   if (S_ISREG (stats->stat.st_mode))
     {




reply via email to

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