From 94fe6d4e7f68c5741b9e74178009c082aa2586f0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 25 Aug 2021 16:18:40 +0000 Subject: Make shutdownd work with CONFIG_TTY=n Signed-off-by: Laurent Bercot --- src/shutdown/s6-linux-init-shutdownd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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") ; -- cgit v1.2.3