diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-08-25 16:18:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-08-25 16:18:40 +0000 |
commit | 94fe6d4e7f68c5741b9e74178009c082aa2586f0 (patch) | |
tree | 1051b3ee2787089563fa3b91bb50e44f5ab4e549 /src/shutdown | |
parent | 0bd454f68a63801e628dd9c4230a4b9e339cfe6e (diff) | |
download | s6-linux-init-94fe6d4e7f68c5741b9e74178009c082aa2586f0.tar.xz |
Make shutdownd work with CONFIG_TTY=n
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/shutdown')
-rw-r--r-- | src/shutdown/s6-linux-init-shutdownd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c index e448b92..eea6da7 100644 --- a/src/shutdown/s6-linux-init-shutdownd.c +++ b/src/shutdown/s6-linux-init-shutdownd.c @@ -147,7 +147,7 @@ static inline void handle_fifo (buffer *b, char *what, tain *deadline, unsigned static void restore_console (void) { fd_close(1) ; - if (open("/dev/console", O_WRONLY) != 1) + if (open("/dev/console", O_WRONLY) != 1 && open("/dev/null", O_WRONLY) != 1) strerr_warnwu1sys("open /dev/console for writing") ; else if (fd_copy(2, 1) < 0) strerr_warnwu1sys("fd_copy") ; |