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.
This commit is contained in:
Daan De Meyer
2022-01-27 14:46:59 +00:00
parent 8bad545354
commit 3a787b5e29
+2 -2
View File
@@ -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) {