From 9a36e7b84a6245e936f1a794740066cffb8c95db Mon Sep 17 00:00:00 2001 From: Tomoki Shirasawa Date: Fri, 13 Feb 2015 16:00:40 +0900 Subject: [PATCH] restart waitpid if it returns with EINTR. --- executer/user/mcexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index ad9da436..af72c7ab 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -1741,7 +1741,8 @@ sync_out: int ret; pid_t pid = w.sr.args[0]; - if ((ret = waitpid(pid, &status, 0)) != pid) { + while ((ret = waitpid(pid, &status, 0)) == -1 && errno == EINTR); + if(ret != pid) { fprintf(stderr, "ERROR: waiting for %lu\n", w.sr.args[0]); }