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

index d4a1c6c..b2b47d6 100644 (file)
@@ -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;
                 }