teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From 095e14ab14e22d4fa605411bb0f47a856c90df8b Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 19 Dec 2013 11:16:12 +0100
Subject: [PATCH] delta: replace readdir_r with readdir

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

diff --git a/src/delta/delta.c b/src/delta/delta.c
index 193642d..c2550d6 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -280,13 +280,13 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch
 
         for (;;) {
                 struct dirent *de;
-                union dirent_storage buf;
                 int k;
                 char *p;
 
-                k = readdir_r(d, &buf.de, &de);
-                if (k != 0)
-                        return -k;
+                errno = 0;
+                de = readdir(d);
+                if (!de && errno != 0)
+                        return -errno;
 
                 if (!de)
                         break;