mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
journal-file: avoid calling ftruncate with invalid fd
This can happen if journal_file_close is called from the failure handling code of journal_file_open before f->fd was established.
This commit is contained in:
parent
0b777d20e9
commit
c52368509f
@ -1846,6 +1846,9 @@ static int journal_file_append_entry_internal(
|
||||
void journal_file_post_change(JournalFile *f) {
|
||||
assert(f);
|
||||
|
||||
if (f->fd < 0)
|
||||
return;
|
||||
|
||||
/* inotify() does not receive IN_MODIFY events from file
|
||||
* accesses done via mmap(). After each access we hence
|
||||
* trigger IN_MODIFY by truncating the journal file to its
|
||||
|
Loading…
Reference in New Issue
Block a user