summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 20:02:36 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 20:02:36 +0000
commit0698c4969cc8688bc9979a8601656ccdc7a2e601 (patch)
tree6f1326dae1b9bef82a51f64e8f54c8359878674e /ext/socket/socket.c
parent2751b5366dd506bdb77a1f1a03b9c108f64eddba (diff)
socket: disable nonblocking-by-default on win32
Perhaps this fixes test failures reported by Greg and k0kubun. However, the failure of certain tests to handle non-blocking I/O seems to indicate pre-existing problems on win32 platforms. Somebody knowledgeable about win32 should be able to fix it. [ruby-core:89973] [ruby-core:89976] [ruby-core:89977] [Bug #14968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index ad2ca5fc67..b6bda8fee8 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -213,8 +213,10 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
fix_cloexec:
rb_maygvl_fd_fix_cloexec(sv[0]);
rb_maygvl_fd_fix_cloexec(sv[1]);
- rsock_make_fd_nonblock(sv[0]);
- rsock_make_fd_nonblock(sv[1]);
+ if (RSOCK_NONBLOCK_DEFAULT) {
+ rsock_make_fd_nonblock(sv[0]);
+ rsock_make_fd_nonblock(sv[1]);
+ }
update_max_fd:
rb_update_max_fd(sv[0]);
@@ -233,8 +235,10 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
rb_fd_fix_cloexec(sv[0]);
rb_fd_fix_cloexec(sv[1]);
- rsock_make_fd_nonblock(sv[0]);
- rsock_make_fd_nonblock(sv[1]);
+ if (RSOCK_NONBLOCK_DEFAULT) {
+ rsock_make_fd_nonblock(sv[0]);
+ rsock_make_fd_nonblock(sv[1]);
+ }
return ret;
}
#endif /* !SOCK_CLOEXEC */