]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
Make it possible to disable AF_UNIX (unix-domain) sockets
authorIan Jackson <iwj@mariner.uk.xensource.com>
Wed, 13 Feb 2008 16:18:49 +0000 (16:18 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 12 May 2008 11:16:23 +0000 (12:16 +0100)
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
vl.c
vnc.c

index 5229c24faa90eec038868c42324a601492c04c7f..0609041362545ffc7980daaf4c61dceebb19f86e 100644 (file)
 #define EINTR       WSAEINTR
 #define EINPROGRESS WSAEINPROGRESS
 
+#ifndef NO_UNIX_SOCKETS
+#define NO_UNIX_SOCKETS 1
+#endif
+
 #else
 
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+
+#ifndef NO_UNIX_SOCKETS
 #include <sys/un.h>
+#endif
 
 #define socket_error() errno
 #define closesocket(s) close(s)
diff --git a/vl.c b/vl.c
index ba98bbb0e83d0796c7ec159a4351e0512c061638..7e0299269ac3de0a542d4c108c525e99adc7290c 100644 (file)
--- 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 2179d38d0883066bed49f1fce2ba54db1c3b591f..ecb23c93cf4eaaf0708760b07c7a9d7f0c44e8c3 100644 (file)
--- 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);