From ad8bc4c6b336e7f833505609fbab178e76f961a2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 22 Oct 2009 13:24:22 +0300 Subject: [PATCH] Don't fake network errno values on Windows Don't pretend there exists errno values for some network errors in the Microsoft C library. Just use the WinSock error values. --- dbus/dbus-sockets-win.h | 4 ---- dbus/dbus-sysdeps-win.c | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dbus/dbus-sockets-win.h b/dbus/dbus-sockets-win.h index 881a1270a..0af5e7b92 100644 --- a/dbus/dbus-sockets-win.h +++ b/dbus/dbus-sockets-win.h @@ -49,10 +49,6 @@ #error This does not look like Win32 and the Microsoft C library #endif -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EWOULDBLOCK WSAEWOULDBLOCK - #define DBUS_SOCKET_IS_INVALID(s) ((SOCKET)(s) == INVALID_SOCKET) #define DBUS_SOCKET_API_RETURNS_ERROR(n) ((n) == SOCKET_ERROR) #define DBUS_SOCKET_SET_ERRNO() errno = WSAGetLastError() diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index b720de4ee..376b5f5aa 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1070,7 +1070,7 @@ _dbus_poll (DBusPollFD *fds, if (DBUS_SOCKET_API_RETURNS_ERROR (ready)) { DBUS_SOCKET_SET_ERRNO (); - if (errno != EWOULDBLOCK) + if (errno != WSAEWOULDBLOCK) _dbus_verbose ("WSAWaitForMultipleEvents: failed: %s\n", strerror (errno)); ret = -1; } @@ -1208,7 +1208,7 @@ _dbus_poll (DBusPollFD *fds, if (DBUS_SOCKET_API_RETURNS_ERROR (ready)) { DBUS_SOCKET_SET_ERRNO (); - if (errno != EWOULDBLOCK) + if (errno != WSAEWOULDBLOCK) _dbus_verbose ("select: failed: %s\n", _dbus_strerror (errno)); } else if (ready == 0) @@ -3224,7 +3224,7 @@ _dbus_flush_caches (void) dbus_bool_t _dbus_get_is_errno_eagain_or_ewouldblock (void) { - return errno == EAGAIN || errno == EWOULDBLOCK; + return errno == WSAEWOULDBLOCK; } /** -- 2.47.3