Don't fake network errno values on Windows
authorTor Lillqvist <tml@iki.fi>
Thu, 22 Oct 2009 10:24:22 +0000 (13:24 +0300)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 1 Dec 2009 09:28:07 +0000 (10:28 +0100)
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
dbus/dbus-sysdeps-win.c

index 881a127..0af5e7b 100644 (file)
 #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()
index b720de4..376b5f5 100644 (file)
@@ -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;
 }
 
 /**