repositories
/
deb_libnfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99c14c9
)
[fix] - fix connect for win32 - return values are inverted
author
unknown
<memphis@machzwo.de>
Fri, 2 Sep 2011 22:58:31 +0000
(
00:58
+0200)
committer
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sat, 3 Sep 2011 05:31:56 +0000
(15:31 +1000)
lib/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/socket.c
b/lib/socket.c
index efe87393108d5038e37869f0d354f87aedeb0a06..760da2f352a2983480485eb903966ef6ded46a3a 100644
(file)
--- a/
lib/socket.c
+++ b/
lib/socket.c
@@
-373,8
+373,12
@@
int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc
rpc->connect_data = private_data;
set_nonblocking(rpc->fd);
-
- if (connect(rpc->fd, (struct sockaddr *)&s, socksize) != 0 && errno != EINPROGRESS) {
+#if defined(WIN32)
+ if (connect(rpc->fd, (struct sockaddr *)&s, socksize) == 0 && GetLastError() != WSAEINPROGRESS )
+#else
+ if (connect(rpc->fd, (struct sockaddr *)&s, socksize) != 0 && errno != EINPROGRESS)
+#endif
+ {
rpc_set_error(rpc, "connect() to server failed");
return -1;
}