From: Ian Jackson Date: Wed, 13 Feb 2008 16:18:49 +0000 (+0000) Subject: Make it possible to disable AF_UNIX (unix-domain) sockets X-Git-Tag: xen-3.3.0-rc1~252 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d91042cafb62fc07436a3a2a8dd1ff247c8bd6d5;p=qemu-xen-4.1-testing.git 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. --- 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);