chiark / gitweb /
journal: allow priority 0 in stdout stream
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 8 Mar 2013 11:05:48 +0000 (12:05 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Fri, 8 Mar 2013 11:08:29 +0000 (12:08 +0100)
Priority 0 is acceptable (it's LOG_EMERG).

BTW, I'm not sure why we allow priorities up to 999, but I'm leaving
this be for now.

http://lists.freedesktop.org/archives/systemd-devel/2013-March/009510.html

src/journal/journald-stream.c

index 7b88f747dbf2829626549663ebd6d4f691392f80..54a5b3621a1f780298a6cb4cb4256754cbfb3132 100644 (file)
@@ -175,7 +175,7 @@ static int stdout_stream_line(StdoutStream *s, char *p) {
 
         case STDOUT_STREAM_PRIORITY:
                 r = safe_atoi(p, &s->priority);
-                if (r < 0 || s->priority <= 0 || s->priority >= 999) {
+                if (r < 0 || s->priority < 0 || s->priority >= 999) {
                         log_warning("Failed to parse log priority line.");
                         return -EINVAL;
                 }