mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-07 14:14:35 +00:00
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
78a5d04dd6
commit
0371ca0dac
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user