summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-03-12 14:59:54 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-05-12 18:34:24 +0100
commit6ac3d6f70ab73c445b79177b20f50b4d90f91b70 (patch)
tree1d7bf0e10482728f10671813e15bc3d903182582
parentcc652d9f0c1f428cf3e71746e75775a061850b36 (diff)
downloaddbus-6ac3d6f70ab73c445b79177b20f50b4d90f91b70.tar.gz
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>
-rw-r--r--dbus/dbus-sockets-win.h15
-rw-r--r--dbus/dbus-sysdeps-win.c2
2 files changed, 2 insertions, 15 deletions
diff --git a/dbus/dbus-sockets-win.h b/dbus/dbus-sockets-win.h
index 4e1ab8ca..a35d6537 100644
--- a/dbus/dbus-sockets-win.h
+++ b/dbus/dbus-sockets-win.h
@@ -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 */
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index f3d41ebc..48b28b3a 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -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)