From d00bc973fe1f5a889bdfb57d4448894434b035be Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 15 Nov 2006 21:18:57 +1000 Subject: [PATCH] Use fcntl to automatically close fishd socken on exec instead of handling it manually darcs-hash:20061115111857-ac50b-3e04a0bc16c8442bef02cf4a50777d4556b8eaa6.gz --- env_universal.c | 2 +- exec.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/env_universal.c b/env_universal.c index c3e5cd907..a069be948 100644 --- a/env_universal.c +++ b/env_universal.c @@ -144,7 +144,7 @@ static int get_socket( int fork_ok ) return -1; } - if( fcntl( s, F_SETFL, O_NONBLOCK ) != 0 ) + if( (fcntl( s, F_SETFL, O_NONBLOCK ) != 0) || (fcntl( s, F_SETFD, FD_CLOEXEC ) != 0) ) { wperror( L"fcntl" ); close( s ); diff --git a/exec.c b/exec.c index 2eecaf33a..b7166ee9b 100644 --- a/exec.c +++ b/exec.c @@ -42,7 +42,6 @@ #include "sanity.h" #include "expand.h" #include "signal.h" -#include "env_universal.h" #include "halloc.h" #include "halloc_util.h" @@ -388,9 +387,6 @@ static int handle_child_io( io_data_t *io, int exit_on_error ) } } - if( env_universal_server.fd >= 0 ) - exec_close( env_universal_server.fd ); - return 0; }