summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:32:23 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:32:23 +0000
commit2fd6766226e3bab7c4f195eb2ea7d95918c37aeb (patch)
tree89e7d97e278a6c2a79ca849d95c45674a9cffa5a /win32
parent7ad4bd137d004ef4db69cc0b45d93ddd8d417b5f (diff)
merges r24367 from trunk into ruby_1_9_1.
-- * win32/win32.c (rb_w32_connect): return value was broken when some error occurred. [ruby-core:24234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/win32/win32.c b/win32/win32.c
index b948fe0d77..bf405e0e64 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2394,14 +2394,11 @@ rb_w32_connect(int s, const struct sockaddr *addr, int addrlen)
RUBY_CRITICAL({
r = connect(TO_SOCKET(s), addr, addrlen);
if (r == SOCKET_ERROR) {
- r = WSAGetLastError();
- if (r != WSAEWOULDBLOCK) {
- errno = map_errno(r);
- }
- else {
+ int err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK)
+ errno = map_errno(err);
+ else
errno = EINPROGRESS;
- r = -1;
- }
}
});
return r;