From d91042cafb62fc07436a3a2a8dd1ff247c8bd6d5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 13 Feb 2008 16:18:49 +0000 Subject: [PATCH] Make it possible to disable AF_UNIX (unix-domain) sockets The patch below makes it possible to disable AF_UNIX (unix-domain) sockets in host environments which do not define _WIN32, by adding -DNO_UNIX_SOCKETS to the compiler flags. This is useful in the effectively-embedded qemu host which are going to be using for device emulation in Xen. --- qemu_socket.h | 7 +++++++ vl.c | 2 +- vnc.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qemu_socket.h b/qemu_socket.h index 5229c24fa..060904136 100644 --- a/qemu_socket.h +++ b/qemu_socket.h @@ -14,12 +14,19 @@ #define EINTR WSAEINTR #define EINPROGRESS WSAEINPROGRESS +#ifndef NO_UNIX_SOCKETS +#define NO_UNIX_SOCKETS 1 +#endif + #else #include #include #include + +#ifndef NO_UNIX_SOCKETS #include +#endif #define socket_error() errno #define closesocket(s) close(s) diff --git a/vl.c b/vl.c index ba98bbb0e..7e0299269 100644 --- a/vl.c +++ b/vl.c @@ -3639,7 +3639,7 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str) return 0; } -#ifndef _WIN32 +#ifndef NO_UNIX_SOCKETS static int parse_unix_path(struct sockaddr_un *uaddr, const char *str) { const char *p; diff --git a/vnc.c b/vnc.c index 2179d38d0..ecb23c93c 100644 --- a/vnc.c +++ b/vnc.c @@ -2188,7 +2188,7 @@ int vnc_display_open(DisplayState *ds, const char *display) } #endif } -#ifndef _WIN32 +#ifndef NO_UNIX_SOCKETS if (strstart(display, "unix:", &p)) { addr = (struct sockaddr *)&uaddr; addrlen = sizeof(uaddr); -- 2.39.5