summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-03-19 19:33:12 +0000
committerJim Meyering <jim@meyering.net>2003-03-19 19:33:12 +0000
commitc8e3afa388395a1c4140de682e0c8fd78497876a (patch)
treee3af3aefc9f7885eb4723f0d89cd9916cad5a331 /lib
parent04ac96ed14d3b24600359564965048957f36b180 (diff)
downloadcoreutils-c8e3afa388395a1c4140de682e0c8fd78497876a.tar.xz
DJGPP doesn't have S_ISLNK, so provide a replacement.
(S_IFMT): Define, if necessary. [STAT_MACROS_BROKEN]: Undefine S_ISLNK. (S_ISLNK): Define, if necessary.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftw.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ftw.c b/lib/ftw.c
index 95d5a1c3d..39c5f625f 100644
--- a/lib/ftw.c
+++ b/lib/ftw.c
@@ -157,6 +157,22 @@ int rpl_lstat (const char *, struct stat *);
# define PATH_MAX 1024
#endif
+#ifndef S_IFMT
+# define S_IFMT 0170000
+#endif
+
+#if STAT_MACROS_BROKEN
+# undef S_ISLNK
+#endif
+
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+# define S_ISLNK(m) 0
+# endif
+#endif
+
struct dir_data
{
DIR *stream;