diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-21 17:35:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 17:35:01 -0500 |
commit | 5978bdd05fed013d301f6d8b089c7c7ea8c0ef8e (patch) | |
tree | 676c5bd2a479a80cbce71ba02c1ada8883989540 /src/basic/log.c | |
parent | a3d8d68cc1698d014575f0f66c58e253bd46c240 (diff) | |
parent | bcab914f7fb0570eb728907163ada55c6ae3d602 (diff) |
Merge pull request #5411 from poettering/various-pre-v233-fixes
Various pre v233 fixes.
Diffstat (limited to 'src/basic/log.c')
-rw-r--r-- | src/basic/log.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index e6d2d61d72..36efc9ac7d 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -72,6 +72,7 @@ static bool show_color = false; static bool show_location = false; static bool upgrade_syslog_to_journal = false; +static bool always_reopen_console = false; /* Akin to glibc's __abort_msg; which is private and we hence cannot * use here. */ @@ -95,7 +96,7 @@ static int log_open_console(void) { if (console_fd >= 0) return 0; - if (getpid() == 1) { + if (always_reopen_console) { console_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC); if (console_fd < 0) return console_fd; @@ -1171,3 +1172,7 @@ int log_syntax_internal( unit_fmt, unit, NULL); } + +void log_set_always_reopen_console(bool b) { + always_reopen_console = b; +} |