chiark / gitweb /
journalctl: don't choke on entries with no MESSAGE= field
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Sep 2012 09:12:31 +0000 (11:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Sep 2012 09:12:31 +0000 (11:12 +0200)
https://bugs.freedesktop.org/show_bug.cgi?id=50177

src/shared/logs-show.c

index d60e5e53081c3cdacf828dc6562ef8837f2a9390..2ddff15bdb8e80a7522736a385056b3e7ed51496 100644 (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;
         }