[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep: defined-S_ISSOCK.diff
From: |
Dimitar Zhekov |
Subject: |
grep: defined-S_ISSOCK.diff |
Date: |
Fri, 18 Apr 2003 13:20:34 +0300 (EEST) |
Testing for DJGPP is not enough to determine if S_ISSOCK is
supported - no MSDOS or WIN32 is guaranteed to support it. For
example, MINGW doesn't support it by default, but may do so if
using a msys posix emulation library. So, perhaps the most fair
test is if the target system has S_ISSOCK defined: according to
posix it's a macro, and I don't know of any system where it's
a function. Maybe a STAT_MACROS_BROKEN / defined S_IFSOCK test
such as in isdir.c should also be done, don't know about that.
--- grep-2.5.orig/src/grep.c 2002-03-13 14:49:52.000000000 +0000
+++ grep-2.5/src/grep.c 2003-04-08 10:29:42.000000000 +0000
@@ -262,7 +262,7 @@
}
if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
return 0;
-#ifndef DJGPP
+#ifdef 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)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep: defined-S_ISSOCK.diff,
Dimitar Zhekov <=