[systemd-devel] [PATCH 05/11] conf-files: replace readdir_r with readdir

Florian Weimer fweimer at redhat.com
Thu Dec 19 02:33:09 PST 2013


---
 src/shared/conf-files.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 92204a6..c86bb03 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -53,13 +53,13 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char
 
         for (;;) {
                 struct dirent *de;
-                union dirent_storage buf;
                 char *p;
                 int r;
 
-                r = readdir_r(dir, &buf.de, &de);
-                if (r != 0)
-                        return -r;
+                errno = 0;
+                de = readdir(dir);
+                if (!de && errno != 0)
+                        return -errno;
 
                 if (!de)
                         break;
-- 
1.8.3.1



More information about the systemd-devel mailing list