journalctl: don't choke on entries with no MESSAGE= field

https://bugs.freedesktop.org/show_bug.cgi?id=50177
This commit is contained in:
Lennart Poettering 2012-09-18 11:12:31 +02:00
parent 57ccf90735
commit c198300fc4

View file

@ -536,6 +536,10 @@ static int output_cat(sd_journal *j, OutputMode mode, unsigned line,
r = sd_journal_get_data(j, "MESSAGE", &data, &l);
if (r < 0) {
/* An entry without MESSAGE=? */
if (r == -ENOENT)
return 0;
log_error("Failed to get data: %s", strerror(-r));
return r;
}