diff options
author | Florian Weimer <fweimer@redhat.com> | 2013-12-19 12:23:12 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-21 18:35:55 -0500 |
commit | 0371ca0dac1d70b2e5060a3c4e6fbbc2bdbd8671 (patch) | |
tree | 1619f44ee0dcd86e389128ad6ee88194411edab8 /src/journal | |
parent | 78a5d04dd61e4a4708c5c017b05724561639e657 (diff) |
journald/server: replace readdir_r with readdir
The available_space function now returns 0 if reading the directory
fails. Previously, such errors were silently ignored.
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journald-server.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 3f8b95dee0..a3bacdab66 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -135,11 +135,11 @@ static uint64_t available_space(Server *s, bool verbose) { for (;;) { struct stat st; struct dirent *de; - union dirent_storage buf; - r = readdir_r(d, &buf.de, &de); - if (r != 0) - break; + errno = 0; + de = readdir(d); + if (!de && errno != 0) + return 0; if (!de) break; |