journal: when dumping journal contents, react nicer to lines we can't read
If journal files are not cleanly closed it might happen that intermediaery journal entries cannot be read. Handle this nicely, skip over the unreadable entries, and log a debug message about it; after all we generally follow the logic that we try to make the best of corrupted files.
This commit is contained in:
@@ -287,7 +287,10 @@ static int output_short(
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (r == -EBADMSG) {
|
||||
log_debug_errno(r, "Skipping message we can't read: %m");
|
||||
return 0;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to get journal fields: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user