/*
* DIRENT functionality can apparently come from many places.
- * I believe these should really be done by OS-specific compat
- * files, but for now its left here.
+ * With various complaints by different compilers
*/
#if HAVE_DIRENT_H
#include <dirent.h>
#endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
+/* The structure dirent also varies between 64-bit and 32-bit environments.
+ * Define our own dirent_t type for consistent simple internal use.
+ * NP: GCC seems not to care about the type naming differences.
+ */
+#if defined(__USE_FILE_OFFSET64) && !defined(__GNUC__)
+#define dirent_t struct dirent64
+#else
+#define dirent_t struct dirent
+#endif
/*
* Filedescriptor limits in the different select loops
{
DIR *dir_pointer = NULL;
- struct dirent *de = NULL;
LOCAL_ARRAY(char, p1, MAXPATHLEN + 1);
LOCAL_ARRAY(char, p2, MAXPATHLEN + 1);
return 0;
}
+ dirent_t *de;
while ((de = readdir(dir_pointer)) != NULL && k < 20) {
if (sscanf(de->d_name, "%X", &swapfileno) != 1)
continue;