Set FD_CLOEXEC in sd_listen_fds

This commit is contained in:
Reynir Björnsson 2020-11-18 21:30:29 +01:00
parent c67bafa063
commit 04ed59202b

View file

@ -39,7 +39,10 @@ let sd_listen_fds () =
| Some listen_pid, Some listen_fds -> | Some listen_pid, Some listen_fds ->
if listen_pid = Unix.getpid () if listen_pid = Unix.getpid ()
then Some (List.init listen_fds then Some (List.init listen_fds
(fun i -> fd_of_int (sd_listen_fds_start + i))) (fun i ->
let fd = fd_of_int (sd_listen_fds_start + i) in
let () = Unix.set_close_on_exec fd in
fd))
else None else None