bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 7/8] Include dirent.h uncontintionally (since gnulib provides it)


From: James Youngman
Subject: [PATCH 7/8] Include dirent.h uncontintionally (since gnulib provides it).
Date: Sun, 5 Jun 2011 01:11:56 +0100

* find/pred.c: Include <dirent.h> unconditionally; gnulib provides it.
* lib/savedirinfo.c: Likewise.
---
 ChangeLog         |    5 +++++
 find/pred.c       |   21 ++-------------------
 lib/savedirinfo.c |   17 ++---------------
 3 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fb4cb73..1e65808 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-06-05  James Youngman  <address@hidden>
 
+       Include dirent.h uncontintionally (since gnulib provides it).
+       * find/pred.c: Include <dirent.h> unconditionally; gnulib provides
+       it.
+       * lib/savedirinfo.c: Likewise.
+
        Silence some false positives for sc_prohibit_always_true_header_tests.
        * .x-sc_prohibit_always_true_header_tests: New file; exclude
        build-aux/src-sniff.py from C inclusion tests, because it itself
diff --git a/find/pred.c b/find/pred.c
index 09b2264..3373378 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -33,6 +33,8 @@
 #include <locale.h>
 #include <ctype.h>
 #include <unistd.h> /* for unlinkat() */
+#include <sys/wait.h>
+#include <dirent.h>
 #include "xalloc.h"
 #include "dirname.h"
 #include "human.h"
@@ -70,25 +72,6 @@
 #endif
 
 
-#include <sys/wait.h>
-
-#if HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
-#  include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-#  include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-#  include <ndir.h>
-# endif
-#endif
-
 #ifdef CLOSEDIR_VOID
 /* Fake a return value. */
 #define CLOSEDIR(d) (closedir (d), 0)
diff --git a/lib/savedirinfo.c b/lib/savedirinfo.c
index 29e8ea9..7dd4d16 100644
--- a/lib/savedirinfo.c
+++ b/lib/savedirinfo.c
@@ -22,24 +22,11 @@
 #include <config.h>
 
 #include <sys/stat.h>
-# include <sys/types.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <errno.h>
+#include <dirent.h>
 
-#if HAVE_DIRENT_H
-# include <dirent.h>
-#else
-# define dirent direct
-# if HAVE_SYS_NDIR_H
-#  include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-#  include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-#  include <ndir.h>
-# endif
-#endif
 
 #ifdef CLOSEDIR_VOID
 /* Fake a return value. */
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]