summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/log.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/shared/log.c b/src/shared/log.c
index ff2dd45350..293c261f9e 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -541,11 +541,11 @@ static int log_dispatch(
k = write_to_journal(level, file, line, func,
object_name, object, buffer);
- if (k <= 0) {
- if (k < 0 && k != -EAGAIN)
+ if (k < 0) {
+ if (k != -EAGAIN)
log_close_journal();
log_open_kmsg();
- } else
+ } else if (k > 0)
r++;
}
@@ -554,11 +554,11 @@ static int log_dispatch(
k = write_to_syslog(level, file, line, func,
object_name, object, buffer);
- if (k <= 0) {
- if (k < 0 && k != -EAGAIN)
+ if (k < 0) {
+ if (k != -EAGAIN)
log_close_syslog();
log_open_kmsg();
- } else
+ } else if (k > 0)
r++;
}
@@ -571,11 +571,10 @@ static int log_dispatch(
k = write_to_kmsg(level, file, line, func,
object_name, object, buffer);
- if (k <= 0) {
- if (k < 0 && k != -EAGAIN)
- log_close_kmsg();
+ if (k < 0) {
+ log_close_kmsg();
log_open_console();
- } else
+ } else if (k > 0)
r++;
}