summaryrefslogtreecommitdiff
path: root/src/journal/journal-vacuum.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-19 22:21:09 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-19 22:21:09 +0200
commit7d5e9c0f60cddf01ec803012cbdc02d2f55b78c1 (patch)
treeecb5dc336ce9e0ecf6d5e3b6757b0a10f7f1e692 /src/journal/journal-vacuum.c
parent57f3067825d9361d7487f272bfaff3b36c684c62 (diff)
util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r(). https://bugzilla.redhat.com/show_bug.cgi?id=858754
Diffstat (limited to 'src/journal/journal-vacuum.c')
-rw-r--r--src/journal/journal-vacuum.c5
1 files changed, 3 insertions, 2 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;