diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-16 16:07:42 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-03-16 16:07:42 +0100 |
commit | d267ac6e647e7bd284842b4ce7d511ad1452e685 (patch) | |
tree | 7aa7d58f5364b68b3fc8fc54b26152074388d289 /src/journal/journald-stream.c | |
parent | sd-event: re-check new epoll events when a child event is queued (diff) | |
download | systemd-d267ac6e647e7bd284842b4ce7d511ad1452e685.tar.xz systemd-d267ac6e647e7bd284842b4ce7d511ad1452e685.zip |
journald: use log_warning_errno() where appropriate
Diffstat (limited to '')
-rw-r--r-- | src/journal/journald-stream.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c index 73b3240677..94add820dc 100644 --- a/src/journal/journald-stream.c +++ b/src/journal/journald-stream.c @@ -385,10 +385,8 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) { case STDOUT_STREAM_LEVEL_PREFIX: r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse level prefix line."); - return -EINVAL; - } + if (r < 0) + return log_warning_errno(r, "Failed to parse level prefix line: %m"); s->level_prefix = r; s->state = STDOUT_STREAM_FORWARD_TO_SYSLOG; @@ -396,10 +394,8 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) { case STDOUT_STREAM_FORWARD_TO_SYSLOG: r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse forward to syslog line."); - return -EINVAL; - } + if (r < 0) + return log_warning_errno(r, "Failed to parse forward to syslog line: %m"); s->forward_to_syslog = r; s->state = STDOUT_STREAM_FORWARD_TO_KMSG; @@ -407,10 +403,8 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) { case STDOUT_STREAM_FORWARD_TO_KMSG: r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse copy to kmsg line."); - return -EINVAL; - } + if (r < 0) + return log_warning_errno(r, "Failed to parse copy to kmsg line: %m"); s->forward_to_kmsg = r; s->state = STDOUT_STREAM_FORWARD_TO_CONSOLE; @@ -418,10 +412,8 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) { case STDOUT_STREAM_FORWARD_TO_CONSOLE: r = parse_boolean(p); - if (r < 0) { - log_warning("Failed to parse copy to console line."); - return -EINVAL; - } + if (r < 0) + return log_warning_errno(r, "Failed to parse copy to console line."); s->forward_to_console = r; s->state = STDOUT_STREAM_RUNNING; |