From 91cc6b315fe458b98e4c3f9be14c2b4a726da925 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 12 Mar 2015 14:59:54 +0000 Subject: [PATCH 04/11] 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. --- dbus/dbus-sockets-win.h | 15 +-------------- dbus/dbus-sysdeps-win.c | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/dbus/dbus-sockets-win.h b/dbus/dbus-sockets-win.h index 4e1ab8c..a35d653 100644 --- a/dbus/dbus-sockets-win.h +++ b/dbus/dbus-sockets-win.h @@ -41,25 +41,12 @@ #include #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 -#include -#include -#include -#include - -#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 */ diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 1f2ffa9..eda9e5c 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -1857,7 +1857,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) -- 2.1.4