]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Improve ftw handling.
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 9113560a76ba6cfc8624a26362cabaf7a68ab35f..6afdf863e2ff53e9a6802c6187fb75dfefd82314 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -343,16 +343,32 @@ extern struct supertype *guess_super(int fd);
 struct stat64;
 #endif
 
+#define HAVE_NFTW  we assume
+#define HAVE_FTW
+
 #ifdef UCLIBC
-  struct FTW {};
+# include <features.h>
+# ifndef  __UCLIBC_HAS_FTW__
+#  undef HAVE_FTW
+#  undef HAVE_NFTW
+# endif
+#endif
+
+#ifdef __dietlibc__
+# undef HAVE_NFTW
+#endif
+
+#ifndef HAVE_NFTW
 # define FTW_PHYS 1
-#else
-# include <ftw.h>
-# ifdef __dietlibc__
-#  define FTW_PHYS 1
+# ifndef HAVE_FTW
+  struct FTW {};
 # endif
 #endif
 
+#ifdef HAVE_FTW
+# include <ftw.h>
+#endif
+
 extern int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s);