mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 00:37:59 +02:00
Mostly remove the remnants of an older socket abstraction layer
This is only used on Windows, and wasn't even a particularly abstract abstraction. I've removed DBUS_SOCKET_IS_INVALID in favour of DBUS_SOCKET_IS_VALID because I prefer to avoid double-negatives. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89444 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
This commit is contained in:
parent
cc652d9f0c
commit
6ac3d6f70a
2 changed files with 2 additions and 15 deletions
|
|
@ -41,25 +41,12 @@
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#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() (_dbus_win_set_errno (WSAGetLastError()))
|
||||
|
||||
#define DBUS_CLOSE_SOCKET(s) closesocket(s)
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define DBUS_SOCKET_IS_INVALID(s) ((s) < 0)
|
||||
#define DBUS_SOCKET_API_RETURNS_ERROR(n) ((n) < 0)
|
||||
#define DBUS_SOCKET_SET_ERRNO() /* empty */
|
||||
|
||||
#define DBUS_CLOSE_SOCKET(s) close(s)
|
||||
#error "dbus-sockets-win.h should not be included on non-Windows"
|
||||
|
||||
#endif /* !Win32 */
|
||||
|
||||
|
|
|
|||
|
|
@ -1859,7 +1859,7 @@ _dbus_accept (DBusSocket listen_fd)
|
|||
retry:
|
||||
client_fd = accept (listen_fd, NULL, NULL);
|
||||
|
||||
if (DBUS_SOCKET_IS_INVALID (client_fd))
|
||||
if (!DBUS_SOCKET_IS_VALID (client_fd))
|
||||
{
|
||||
DBUS_SOCKET_SET_ERRNO ();
|
||||
if (errno == EINTR)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue