mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
test-journal-flush: do not croak on corrupted input files
We would fail if the input file was corrupted: build/test-journal-flush ./system@0005b7dac334f805-0021aca076ae5c5e.journal\~ journal_file_copy_entry failed: Bad message Assertion 'r >= 0' failed at src/libsystemd/sd-journal/test-journal-flush.c:55, function main(). Aborting. [1] 619472 IOT instruction (core dumped) build/test-journal-flush ./system@0005b7dac334f805-0021aca076ae5c5e.journal\~ Let's skip some "reasonable" errors. Fixes #17963.
This commit is contained in:
parent
0fa167cd58
commit
b4046d5557
@ -51,8 +51,11 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
r = journal_file_copy_entry(f, new_journal, o, f->current_offset);
|
||||
if (r < 0)
|
||||
log_error_errno(r, "journal_file_copy_entry failed: %m");
|
||||
assert_se(r >= 0);
|
||||
log_warning_errno(r, "journal_file_copy_entry failed: %m");
|
||||
assert_se(r >= 0 ||
|
||||
IN_SET(r, -EBADMSG, /* corrupted file */
|
||||
-EPROTONOSUPPORT, /* unsupported compression */
|
||||
-EIO)); /* file rotated */
|
||||
|
||||
if (++n >= 10000)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user