Set FD_CLOEXEC in sd_listen_fds
This commit is contained in:
parent
c67bafa063
commit
04ed59202b
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue