findutils-patches
[Top][All Lists]
Advanced

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

[Findutils-patches] [PATCH 2/5] Adopt (explicitly) the use of the gnulib


From: James Youngman
Subject: [Findutils-patches] [PATCH 2/5] Adopt (explicitly) the use of the gnulib module dirent-safer.
Date: Thu, 8 Apr 2010 02:44:51 +0100

* import-gnulib.config (modules): Add dirent-safer; we were
previously transitively importing this module, but we are now
importing it directly.
* lib/savedirinfo.c: Include opendir-safer.h.
(xsavedir): Call opendir_safer instead of opendir.

Signed-off-by: James Youngman <address@hidden>
---
 ChangeLog            |    7 +++++++
 import-gnulib.config |    2 +-
 lib/savedirinfo.c    |    3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b6b8b52..d00cebe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-04-08  James Youngman  <address@hidden>
 
+       Adopt (explicitly) the use of the gnulib module dirent-safer.
+       * import-gnulib.config (modules): Add dirent-safer; we were
+       previously transitively importing this module, but we are now
+       importing it directly.
+       * lib/savedirinfo.c: Include opendir-safer.h.
+       (xsavedir): Call opendir_safer instead of opendir.
+
        Adopt the use of the gnulib module d-type.
        * import-gnulib.config (modules): Import the d-type module.
        * configure.ac: Remove old struct dirent.d_type detection logic
diff --git a/import-gnulib.config b/import-gnulib.config
index 519252d..5abe74a 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -24,7 +24,6 @@ maintainer-makefile
 update-copyright
 '
 
-# consider using dirent-safer
 # consider using do-release-commit-and-tag
 # consider using faccessat
 # consider using gendocs
@@ -72,6 +71,7 @@ closein
 closeout
 ctype
 d-type
+dirent-safer
 dirname
 errno
 error
diff --git a/lib/savedirinfo.c b/lib/savedirinfo.c
index 0945058..d9b6000 100644
--- a/lib/savedirinfo.c
+++ b/lib/savedirinfo.c
@@ -62,6 +62,7 @@
 
 #include "xalloc.h"
 #include "extendbuf.h"
+#include "dirent-safer.h"
 #include "savedirinfo.h"
 
 #if defined HAVE_STRUCT_DIRENT_D_TYPE
@@ -154,7 +155,7 @@ xsavedir (const char *dir, int flags)
   size_t entrybuf_allocated = 0u;
   int save_errno;
 
-  dirp = opendir (dir);
+  dirp = opendir_safer (dir);
   if (dirp == NULL)
     return NULL;
 
-- 
1.7.0





reply via email to

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