aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/spawn.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 /lib/spawn.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 'lib/spawn.ml')
-rw-r--r--lib/spawn.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/spawn.ml b/lib/spawn.ml
index e350926b7..f32aa4d62 100644
--- a/lib/spawn.ml
+++ b/lib/spawn.ml
@@ -221,9 +221,11 @@ let kill_if p ~sec test =
false
end else true)
-let wait { pid = (unixpid, _) } =
- try snd (Unix.waitpid [] unixpid)
- with Unix.Unix_error _ -> Unix.WEXITED 0o400
+let rec wait p =
+ try snd (Unix.waitpid [] (fst p.pid))
+ with
+ | Unix.Unix_error (Unix.EINTR, _, _) -> wait p
+ | Unix.Unix_error _ -> Unix.WEXITED 0o400
end