1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

log: don't reopen /dev/console each time we call log_open()

Instead, force reopen it only if we really really have to.
This commit is contained in:
Lennart Poettering 2013-12-18 05:07:34 +01:00
parent bf108e5541
commit 99f098257f
3 changed files with 2 additions and 2 deletions

View File

@ -1328,6 +1328,7 @@ int main(int argc, char *argv[]) {
/* Running inside a container, as PID 1 */
arg_running_as = SYSTEMD_SYSTEM;
log_set_target(LOG_TARGET_CONSOLE);
log_close_console(); /* force reopen of /dev/console */
log_open();
/* For the later on, see above... */

View File

@ -155,6 +155,7 @@ int main(int argc, char *argv[]) {
log_parse_environment();
log_set_target(LOG_TARGET_CONSOLE); /* syslog will die if not gone yet */
log_close_console(); /* force reopen of /dev/console */
log_open();
umask(0022);

View File

@ -272,8 +272,6 @@ int log_open(void) {
log_close_journal();
log_close_syslog();
/* Get the real /dev/console if we are PID=1, hence reopen */
log_close_console();
return log_open_console();
}