sd-journal: fix check in journal_file_verify_header()

Fixes 6ea51363c8
This commit is contained in:
Antonio Alvarez Feijoo
2024-04-05 13:03:19 +02:00
committed by Daan De Meyer
parent aaa872a713
commit 1eeae735ad
+3 -3
View File
@@ -638,7 +638,7 @@ static int journal_file_verify_header(JournalFile *f) {
return -ENODATA;
if (!VALID_REALTIME(le64toh(f->header->tail_entry_realtime)))
return -ENODATA;
if (!VALID_MONOTONIC(le64toh(f->header->tail_entry_realtime)))
if (!VALID_MONOTONIC(le64toh(f->header->tail_entry_monotonic)))
return -ENODATA;
} else {
/* Otherwise, the fields must be zero. */
@@ -649,7 +649,7 @@ static int journal_file_verify_header(JournalFile *f) {
return -ENODATA;
if (f->header->tail_entry_realtime != 0)
return -ENODATA;
if (f->header->tail_entry_realtime != 0)
if (f->header->tail_entry_monotonic != 0)
return -ENODATA;
}
}
@@ -2531,7 +2531,7 @@ int journal_file_append_entry(
ts->realtime);
if (!VALID_MONOTONIC(ts->monotonic))
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
"Invalid monotomic timestamp %" PRIu64 ", refusing entry.",
"Invalid monotonic timestamp %" PRIu64 ", refusing entry.",
ts->monotonic);
} else {
dual_timestamp_now(&_ts);