diff options
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journal-vacuum.c | 5 | ||||
-rw-r--r-- | src/journal/journald.c | 5 | ||||
-rw-r--r-- | src/journal/sd-journal.c | 10 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c index c890146537..ac16bdfcfd 100644 --- a/src/journal/journal-vacuum.c +++ b/src/journal/journal-vacuum.c @@ -86,7 +86,8 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m for (;;) { int k; - struct dirent buf, *de; + struct dirent *de; + union dirent_storage buf; size_t q; struct stat st; char *p; @@ -94,7 +95,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m sd_id128_t seqnum_id; bool have_seqnum; - k = readdir_r(d, &buf, &de); + k = readdir_r(d, &buf.de, &de); if (k != 0) { r = -k; goto finish; diff --git a/src/journal/journald.c b/src/journal/journald.c index 74c80f5a08..164e1087d1 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -141,9 +141,10 @@ static uint64_t available_space(Server *s) { for (;;) { struct stat st; - struct dirent buf, *de; + struct dirent *de; + union dirent_storage buf; - r = readdir_r(d, &buf, &de); + r = readdir_r(d, &buf.de, &de); if (r != 0) break; diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 2fa81727e0..acde84fe2d 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -1256,9 +1256,10 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname) } for (;;) { - struct dirent buf, *de; + struct dirent *de; + union dirent_storage buf; - r = readdir_r(d, &buf, &de); + r = readdir_r(d, &buf.de, &de); if (r != 0 || !de) break; @@ -1334,10 +1335,11 @@ static int add_root_directory(sd_journal *j, const char *p) { } for (;;) { - struct dirent buf, *de; + struct dirent *de; + union dirent_storage buf; sd_id128_t id; - r = readdir_r(d, &buf, &de); + r = readdir_r(d, &buf.de, &de); if (r != 0 || !de) break; |