From 816fa8d14d416d1a767a0fc762c48f215a8af4ed Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 9 Feb 2005 07:34:56 +0000 Subject: [PATCH] * ext/socket/socket.c (wait_connectable): fixed wrong condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/socket/socket.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 18a1547934..3b840a7aad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 9 16:33:05 2005 NAKAMURA Usaku + + * ext/socket/socket.c (wait_connectable): fixed wrong condition. + Wed Feb 9 14:42:28 2005 URABE Shyouhei * eval.c (scope_dup): add volatile not to optimize tbl. diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 2ffa84b296..53d4506b79 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -825,8 +825,11 @@ wait_connectable(fd) else if (FD_ISSET(fd, &fds_e)) { sockerrlen = sizeof(sockerr); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, - &sockerrlen)) + &sockerrlen) == 0) { + if (sockerr == 0) + continue; /* workaround for winsock */ errno = sockerr; + } return -1; } }