[Top][All Lists]
[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
- [PATCH 1/8] Add internationalisation support to bigram but not regexprops., James Youngman, 2011/06/04
- [PATCH 6/8] Silence some false positives for sc_prohibit_always_true_header_tests., James Youngman, 2011/06/04
- [PATCH 8/8] Avoid some false positives for the sc_prohibit_doubled_word check., James Youngman, 2011/06/04
- [PATCH 3/8] Use the gnulib byteswap and uname modules., James Youngman, 2011/06/04
- [PATCH 2/8] gnulib already defines O_CLOEXEC., James Youngman, 2011/06/04
- [PATCH 4/8] Update xargs error message., James Youngman, 2011/06/04
- [PATCH 5/8] Prefer "cannot" to "can not"., James Youngman, 2011/06/04
- [PATCH 7/8] Include dirent.h uncontintionally (since gnulib provides it).,
James Youngman <=