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;
}
#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_