From aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Feb 2023 17:11:30 +0100 Subject: Adding upstream version 1.38.0. Signed-off-by: Daniel Baumann --- spawn/spawn_server.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'spawn/spawn_server.c') diff --git a/spawn/spawn_server.c b/spawn/spawn_server.c index 53b143dea..1d79ef15d 100644 --- a/spawn/spawn_server.c +++ b/spawn/spawn_server.c @@ -317,10 +317,7 @@ void spawn_server(void) // close all open file descriptors, except the standard ones // the caller may have left open files (lxc-attach has this issue) - int fd; - for(fd = (int)(sysconf(_SC_OPEN_MAX) - 1) ; fd > 2 ; --fd) - if(fd_is_valid(fd)) - close(fd); + for_each_open_fd(OPEN_FD_ACTION_CLOSE, OPEN_FD_EXCLUDE_STDIN | OPEN_FD_EXCLUDE_STDOUT | OPEN_FD_EXCLUDE_STDERR); // Have the libuv IPC pipe be closed when forking child processes (void) fcntl(0, F_SETFD, FD_CLOEXEC); -- cgit v1.2.3