[systemd-devel] [PATCH 08/11] journal/vacuum: replace readdir_r with readdir

Florian Weimer fweimer at redhat.com
Thu Dec 19 03:15:58 PST 2013


---
 src/journal/journal-vacuum.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index d4a1c6c..b2b47d6 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -180,9 +180,7 @@ int journal_directory_vacuum(
                 return -errno;
 
         for (;;) {
-                int k;
                 struct dirent *de;
-                union dirent_storage buf;
                 size_t q;
                 struct stat st;
                 char *p;
@@ -190,9 +188,10 @@ int journal_directory_vacuum(
                 sd_id128_t seqnum_id;
                 bool have_seqnum;
 
-                k = readdir_r(d, &buf.de, &de);
-                if (k != 0) {
-                        r = -k;
+                errno = 0;
+                de = readdir(d);
+                if (!de && errno != 0) {
+                        r = -errno;
                         goto finish;
                 }
 
-- 
1.8.3.1



More information about the systemd-devel mailing list