[systemd-devel] [PATCH 01/11] tmpfiles: replace readdir_r with readdir

Florian Weimer fweimer at redhat.com
Thu Dec 19 03:26:07 PST 2013


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

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index b7f6a2e..e83a73e 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -543,15 +543,15 @@ static int recursive_relabel_children(Item *i, const char *path) {
 
         for (;;) {
                 struct dirent *de;
-                union dirent_storage buf;
                 bool is_dir;
                 int r;
                 _cleanup_free_ char *entry_path = NULL;
 
-                r = readdir_r(d, &buf.de, &de);
-                if (r != 0) {
+                errno = 0;
+                de = readdir(d);
+                if (!de && errno != 0) {
                         if (ret == 0)
-                                ret = -r;
+                                ret = -errno;
                         break;
                 }
 
-- 
1.8.3.1



More information about the systemd-devel mailing list