From 53ed44a9a595920a838e8646088a302db1048b53 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Tue, 24 Mar 2009 15:54:19 +0000 Subject: [PATCH] --- unixsocketwatcher.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unixsocketwatcher.ml b/unixsocketwatcher.ml index 517d7e0..fa46e69 100644 --- a/unixsocketwatcher.ml +++ b/unixsocketwatcher.ml @@ -44,6 +44,10 @@ let receive_event (listening_socket_spec:fname_and_fd) (_:fname_and_fd) = (* Close all fds except for the socket *) let fd = Obj.magic data_socket in let _ = + (* Close fds *) + for i = 3 to 1023 do + if (i != fd) then close_if_open(i) + done; execv execpath [|execpath;slice_name;sprintf "%d" fd|] (*with Unix_error(num,str1,str2)->logprint "Error %d: %s (%s)" (Obj.magic num) str1 str2;raise (Unix_error(num,str1,str2))*) in -- 2.43.0