From 74bd95d10b9f4cccb4bd5b855786c444492b201b Mon Sep 17 00:00:00 2001 From: Pierre Letouzey Date: Tue, 21 Jan 2014 20:12:58 +0100 Subject: Relaunch all Unix.waitpid when they ended with EINTR Moreover, cleanup of System.connect (used by the "external" tactic). --- lib/spawn.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/spawn.ml') 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 -- cgit v1.2.3