You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5953 Reporter:@diml Assigned to:@diml Status: closed (set by @xavierleroy on 2015-12-11T18:18:34Z) Resolution: open Priority: low Severity: minor Version: 4.01.0+dev Target version: 4.01.0+dev Category: otherlibs Monitored by:@dbuenzli
Bug description
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:
this is what the system(3) function of the libc does
the user does not have the pid of the sub-process so it cannot restart the call if it is interrupted
The attached patch replace the call to waitpid in Unix.system by one to waitpid_non_intr.
Original bug ID: 5953
Reporter: @diml
Assigned to: @diml
Status: closed (set by @xavierleroy on 2015-12-11T18:18:34Z)
Resolution: open
Priority: low
Severity: minor
Version: 4.01.0+dev
Target version: 4.01.0+dev
Category: otherlibs
Monitored by: @dbuenzli
Bug description
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
#load "unix.cma";;
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", "").
File attachments
The text was updated successfully, but these errors were encountered: