Commit ad8bc4c6 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Ralf Habacker

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.
parent 9bb7297a
......@@ -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()
......
......@@ -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;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment