From ddfb27b5dd1db23d36800a1a8d8211c2aa1b65c1 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 6 Jul 2023 12:59:00 +0000 Subject: Use open2() safe wrapper Signed-off-by: Laurent Bercot --- src/shutdown/s6-linux-init-shutdownd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shutdown') diff --git a/src/shutdown/s6-linux-init-shutdownd.c b/src/shutdown/s6-linux-init-shutdownd.c index e6c05b9..b53042e 100644 --- a/src/shutdown/s6-linux-init-shutdownd.c +++ b/src/shutdown/s6-linux-init-shutdownd.c @@ -146,7 +146,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 && open("/dev/null", O_WRONLY) != 1) + if (open2("/dev/console", O_WRONLY) != 1 && open2("/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.3.1