aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/micromega/mutils.ml
diff options
context:
space:
mode:
authorGravatar Pierre Letouzey <pierre.letouzey@inria.fr>2014-01-21 20:12:58 +0100
committerGravatar Pierre Letouzey <pierre.letouzey@inria.fr>2014-01-30 18:51:53 +0100
commit74bd95d10b9f4cccb4bd5b855786c444492b201b (patch)
treeda7da320707952096c3a95511b772e9c5eb44848 /plugins/micromega/mutils.ml
parent2fa5d8befba9ef24629233a3620494760583f75f (diff)
Relaunch all Unix.waitpid when they ended with EINTR
Moreover, cleanup of System.connect (used by the "external" tactic).
Diffstat (limited to 'plugins/micromega/mutils.ml')
-rw-r--r--plugins/micromega/mutils.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/micromega/mutils.ml b/plugins/micromega/mutils.ml
index 0b98696c9..ae89364e6 100644
--- a/plugins/micromega/mutils.ml
+++ b/plugins/micromega/mutils.ml
@@ -403,6 +403,12 @@ end
module TagSet = Set.Make(Tag)
+(** As for Unix.close_process, our Unix.waipid will ignore all EINTR *)
+
+let rec waitpid_non_intr pid =
+ try snd (Unix.waitpid [] pid)
+ with Unix.Unix_error (Unix.EINTR, _, _) -> waitpid_non_intr pid
+
(**
* Forking routine, plumbing the appropriate pipes where needed.
*)
@@ -422,7 +428,7 @@ let command exe_path args vl =
flush outch ;
(* Wait for its completion *)
- let _pid,status = Unix.waitpid [] pid in
+ let status = waitpid_non_intr pid in
finally
(* Recover the result *)