mirror of
https://github.com/systemd/systemd.git
synced 2025-03-30 10:50:15 +03:00
Revert "log: fix fallbacks to kmsg"
This reverts commit 4a01181e460686d8b4a543b1dfa7f77c9e3c5ab8. This patch broke LOG_TARGET_AUTO, i.e. automatic selection of STDERR if it is a TTY with a fallback on the journal and kmsg otherwise. The general rule should probably be: log_open() -- open the "best" possible logging channel according to log_target configuration. log_dispatch() -- don't open any log channels ever, with the exception of kmsg since that has no drawbacks. And do this only on true errors of the better log channel, not just when it wasn't opened.
This commit is contained in:
parent
c06bf41404
commit
4e7bc3f339
@ -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++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user