chiark / gitweb /
conf-files: replace readdir_r with readdir
authorFlorian Weimer <fweimer@redhat.com>
Thu, 19 Dec 2013 10:33:09 +0000 (11:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 21 Dec 2013 23:35:55 +0000 (18:35 -0500)
src/shared/conf-files.c

index 92204a6..c86bb03 100644 (file)
@@ -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;