summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-01-26 00:53:58 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-01-27 15:46:59 +0100
commit3a787b5e2954b79f0604063ad9b5a3f4af04f249 (patch)
tree0a652660ca56e630bf8f552d6ae6a0f2189253d8
parentjournal: Stop comparing hash values from entry items against data objects (diff)
downloadsystemd-3a787b5e2954b79f0604063ad9b5a3f4af04f249.tar.xz
systemd-3a787b5e2954b79f0604063ad9b5a3f4af04f249.zip
journal: stat journal file after truncating
Let's make sure the data stored in last_stat is up-to-date after truncating the journal file.
Diffstat (limited to '')
-rw-r--r--src/journal/journald-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journald-file.c b/src/journal/journald-file.c
index 0e698e329b..9337925ffd 100644
--- a/src/journal/journald-file.c
+++ b/src/journal/journald-file.c
@@ -31,9 +31,9 @@ static int journald_file_truncate(JournalFile *f) {
f->header->arena_size = htole64(p - le64toh(f->header->header_size));
if (ftruncate(f->fd, p) < 0)
- log_debug_errno(errno, "Failed to truncate %s: %m", f->path);
+ return log_debug_errno(errno, "Failed to truncate %s: %m", f->path);
- return 0;
+ return journal_file_fstat(f);
}
static int journald_file_entry_array_punch_hole(JournalFile *f, uint64_t p, uint64_t n_entries) {