1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
charliesome 2014-01-23 05:07:48 +00:00
parent 25daaafa3d
commit 0a881f81b1

View file

@ -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) &&