Unix.system does not handle EINTR #5953
Original bug ID: 5953
Right now Unix.system calls waitpid and does not handle EINTR. This means that if a signal handler is set somewhere else in the program a call to Unix.system may fail with this error.
I think Unix.system should waitpid again until it does not fail with EINTR since:
The attached patch replace the call to waitpid in Unix.system by one to waitpid_non_intr.
Steps to reproduce
Sys.set_signal Sys.sigchld (Sys.Signal_handle ignore);;
let ic = Unix.open_process_in "sleep 5";;
val ic : in_channel =
Unix.system "sleep 10";;
Exception: Unix.Unix_error (Unix.EINTR, "waitpid", "").
The text was updated successfully, but these errors were encountered: