diff options
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/socket.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c index b512839626..b870677aab 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -916,7 +916,8 @@ wait_connectable0(fd, fds_w, fds_e) int fd; rb_fdset_t *fds_w, *fds_e; { - int sockerr, sockerrlen; + int sockerr; + socklen_t sockerrlen; for (;;) { rb_fd_zero(fds_w); @@ -1011,7 +1012,9 @@ ruby_connect(fd, sockaddr, len, socks) int socks; { int status; +#if defined(HAVE_FCNTL) int mode; +#endif #if WAIT_IN_PROGRESS > 0 int wait_in_progress = -1; int sockerr, sockerrlen; @@ -1055,6 +1058,9 @@ ruby_connect(fd, sockaddr, len, socks) #ifdef EINPROGRESS case EINPROGRESS: #endif +#if defined(HAVE_FCNTL) + if (mode & NONBLOCKING) break; +#endif #if WAIT_IN_PROGRESS > 0 sockerrlen = sizeof(sockerr); status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen); |