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~242^2~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=456c0b147a1bdf2d23d7b505e7e085fc280101c7;p=deb_libnfs.git Fixed errno processing for connect() on Windows. --- diff --git a/lib/socket.c b/lib/socket.c index c64bf2e..3fa8378 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -411,13 +411,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_