summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-18 11:12:31 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-18 11:12:31 +0200
commitc198300fc44cdc62b43d7458ab9278b9c46fd733 (patch)
tree1f480dabca27651f6308b343cabfb8cb8f0b3e47
parent57ccf9073531e09890257d70d3176fec43da29a7 (diff)
journalctl: don't choke on entries with no MESSAGE= field
https://bugs.freedesktop.org/show_bug.cgi?id=50177
-rw-r--r--src/shared/logs-show.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index d60e5e5308..2ddff15bdb 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -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;
}