summaryrefslogtreecommitdiff
path: root/src/journal/journald-stream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-27 14:03:49 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-27 14:03:49 +0100
commitd353a16d1fe978093e8caae2743cd16356559d8d (patch)
treea1909e918debb71b1cd75167b0a1b8068d5db32f /src/journal/journald-stream.c
parent97839ed6b7b19e2cb885a152b54fbd32334294e2 (diff)
parentcfa1b98e832026b0fa5f1ca2f8f5f65bddf12a31 (diff)
Merge pull request #1937 from evverx/fix-stdout-parsing
Fix stdout stream parsing
Diffstat (limited to 'src/journal/journald-stream.c')
-rw-r--r--src/journal/journald-stream.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index fb800782fb..07a0f1bf41 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -239,14 +239,14 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
assert(s);
assert(p);
- if (isempty(p))
- return 0;
-
priority = s->priority;
if (s->level_prefix)
syslog_parse_priority(&p, &priority, false);
+ if (isempty(p))
+ return 0;
+
if (s->forward_to_syslog || s->server->forward_to_syslog)
server_forward_syslog(s->server, syslog_fixup_facility(priority), s->identifier, p, &s->ucred, NULL);
@@ -286,10 +286,12 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
static int stdout_stream_line(StdoutStream *s, char *p) {
int r;
+ char *orig;
assert(s);
assert(p);
+ orig = p;
p = strstrip(p);
switch (s->state) {
@@ -378,7 +380,7 @@ static int stdout_stream_line(StdoutStream *s, char *p) {
return 0;
case STDOUT_STREAM_RUNNING:
- return stdout_stream_log(s, p);
+ return stdout_stream_log(s, orig);
}
assert_not_reached("Unknown stream state");