]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
DJGPP doesn't have S_ISLNK, so provide a replacement.
authorJim Meyering <jim@meyering.net>
Wed, 19 Mar 2003 19:33:12 +0000 (19:33 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 19 Mar 2003 19:33:12 +0000 (19:33 +0000)
(S_IFMT): Define, if necessary.
[STAT_MACROS_BROKEN]: Undefine S_ISLNK.
(S_ISLNK): Define, if necessary.

lib/ftw.c

index 95d5a1c3d3565a16bb2b5e0fa7a7615d45368116..39c5f625fe7e9220ec7fa99107853c8225a007b1 100644 (file)
--- 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;