1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

journal: small simplification

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-05-29 17:01:53 +02:00
parent 8d96289711
commit 846e541830

View File

@ -212,7 +212,7 @@ int journal_file_set_offline(JournalFile *f, bool wait) {
if (!f->writable)
return -EPERM;
if (!(f->fd >= 0 && f->header))
if (f->fd < 0 || !f->header)
return -EINVAL;
/* An offlining journal is implicitly online and may modify f->header->state,
@ -269,7 +269,7 @@ static int journal_file_set_online(JournalFile *f) {
if (!f->writable)
return -EPERM;
if (!(f->fd >= 0 && f->header))
if (f->fd < 0 || !f->header)
return -EINVAL;
while (wait) {