From: Rudi Ihle Date: Thu, 14 Jun 2012 07:23:25 +0000 (+0200) Subject: Fixed errno processing for connect() on Windows. X-Git-Tag: upstream/1.9.6^2~252^2~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f96b24fadad7dddbd4162bf8fdb2e9c9206bb2a7;p=deb_libnfs.git Fixed errno processing for connect() on Windows. --- diff --git a/lib/socket.c b/lib/socket.c index c746c76..1bb34f0 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -412,13 +412,8 @@ static int rpc_connect_sockaddr_async(struct rpc_context *rpc, struct sockaddr_s set_nonblocking(rpc->fd); -#if defined(WIN32) - if (connect(rpc->fd, (struct sockaddr *)s, socksize) == 0 && errno != EINPROGRESS ) -#else - if (connect(rpc->fd, (struct sockaddr *)s, socksize) != 0 && errno != EINPROGRESS) -#endif - { - rpc_set_error(rpc, "connect() to server failed. %s(%d)", strerror(errno), errno); + if (connect(rpc->fd, (struct sockaddr *)s, socksize) != 0 && errno != EINPROGRESS) { + rpc_set_error(rpc, "connect() to server failed. %s(%d)", strerror(errno), errno); return -1; } diff --git a/win32/win32_errnowrapper.h b/win32/win32_errnowrapper.h index 4477d3f..ebed01c 100644 --- a/win32/win32_errnowrapper.h +++ b/win32/win32_errnowrapper.h @@ -9,7 +9,8 @@ #undef EINPROGRESS #define EWOULDBLOCK WSAEWOULDBLOCK -#define EAGAIN WSAEWOULDBLOCK //same on windows +#define EAGAIN WSAEWOULDBLOCK //same on windows #define EINTR WSAEINTR -#define EINPROGRESS WSAEINPROGRESS +#define EINPROGRESS WSAEWOULDBLOCK //does not map to WSAEINPROGRESS ! + #endif //WIN32_ERRNOWRAPPER_H_