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:
Lennart Poettering
2016-04-26 12:00:03 +02:00
parent 50809d7a9c
commit d00f1d57cc
+4 -1
View File
@@ -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");