Clarify why we do SIGINT/SIGHUP shenanigans

This commit is contained in:
Stéphane Lavergne 2023-08-08 14:22:55 -04:00 committed by Simon Cruanes
parent def4414676
commit b36ea35703

View file

@ -956,6 +956,8 @@ module Unix_tcp_server_ = struct
try
let client_sock, _ = Unix.accept sock in
Unix.setsockopt client_sock Unix.TCP_NODELAY true;
(* Block INT/HUP while cloning to avoid children handling them.
When thread gets them, our Unix.accept raises neatly. *)
ignore Unix.(sigprocmask SIG_BLOCK Sys.[ sigint; sighup ]);
self.new_thread (fun () ->
try