summaryrefslogtreecommitdiff
path: root/ext/socket/init.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-10 01:41:59 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-10 01:41:59 +0000
commit91987f6b047afba7ffe4852539a15c214bdf56ba (patch)
treecc96c5a96123040b97e60d3b4cb01feedffaa263 /ext/socket/init.c
parent7d59a9631405b68e7aec9dbcf5e513649b779ceb (diff)
* ext/socket/{basicksocket,init,udpsocket}.c: revert some parts of
r36944. it breaks mswin/mingw ruby and brought into many many crashes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/init.c')
-rw-r--r--ext/socket/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 3960a23..696b62d 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -130,6 +130,7 @@ rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
RBASIC(str)->klass = 0;
while (rb_io_check_closed(fptr),
+ rb_thread_wait_fd(arg.fd),
(slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) {
if (!rb_io_wait_readable(fptr->fd)) {
rb_sys_fail("recvfrom(2)");
@@ -559,6 +560,7 @@ rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
arg.sockaddr = sockaddr;
arg.len = len;
retry:
+ rb_thread_wait_fd(fd);
fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
if (fd2 < 0) {
switch (errno) {