summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;