]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journald: use log_warning_errno() where appropriate
authorLennart Poettering <lennart@poettering.net>
Tue, 12 May 2020 16:52:33 +0000 (18:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 May 2020 19:32:25 +0000 (21:32 +0200)
src/journal/journald-stream.c

index 6c10bfc259312712614f25da1c72fd8ebc2c8d14..e4f0ee36f44162dd73c60f3457eb3702298e39f8 100644 (file)
@@ -322,8 +322,8 @@ static int stdout_stream_log(StdoutStream *s, const char *p, LineBreak line_brea
 }
 
 static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) {
-        int r;
         char *orig;
+        int r;
 
         assert(s);
         assert(p);
@@ -332,10 +332,9 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) {
         p = strstrip(p);
 
         /* line breaks by NUL, line max length or EOF are not permissible during the negotiation part of the protocol */
-        if (line_break != LINE_BREAK_NEWLINE && s->state != STDOUT_STREAM_RUNNING) {
-                log_warning("Control protocol line not properly terminated.");
-                return -EINVAL;
-        }
+        if (line_break != LINE_BREAK_NEWLINE && s->state != STDOUT_STREAM_RUNNING)
+                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
+                                         "Control protocol line not properly terminated.");
 
         switch (s->state) {