summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-23 05:07:48 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-23 05:07:48 +0000
commit0a881f81b1d897740ec5a91c0f4a1bbccfe0c00a (patch)
treec7da8a5b405e3094d2ab388cd69551fb5fc7dbab
parent25daaafa3d32be5bf6b13bf7b917128135366f6d (diff)
* process.c (recv_child_error): Fix deadlock in rb_fork_internal when a
signal is sent to the parent process while Ruby is forking in IO.popen. Patch by Scott Francis. Closes GH-513. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--process.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/process.c b/process.c
index f5d8497..6c29423 100644
--- a/process.c
+++ b/process.c
@@ -3339,8 +3339,11 @@ recv_child_error(int fd, int *statep, VALUE *excp, int *errp, char *errmsg, size
}
#define READ_FROM_CHILD(ptr, len) \
(NIL_P(io) ? read(fd, (ptr), (len)) : rb_io_bufread(io, (ptr), (len)))
- if ((size = READ_FROM_CHILD(&err, sizeof(err))) < 0) {
+ while ((size = READ_FROM_CHILD(&err, sizeof(err))) < 0) {
err = errno;
+ if (err != EINTR) {
+ break;
+ }
}
*errp = err;
if (size == sizeof(err) &&