diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-07-06 12:59:00 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2023-07-06 12:59:00 +0000 |
| commit | ddfb27b5dd1db23d36800a1a8d8211c2aa1b65c1 (patch) | |
| tree | f43bd3860da03ee2e4e81a80aabbcd300d8899de /src/shutdown | |
| parent | 2b4c0fb6a45c17bd3b2e05effa74abbb61f726dc (diff) | |
| download | s6-linux-init-ddfb27b5dd1db23d36800a1a8d8211c2aa1b65c1.tar.gz | |
Use open2() safe wrapper
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 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") ; |
