]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix undefined reference to 'close_used_without_including_unistd_h'
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 22 Dec 2009 02:06:57 +0000 (03:06 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 22 Dec 2009 12:04:50 +0000 (13:04 +0100)
Found while trying to cross-compile libvirt on Fedora 12 for Windows.
gnulib redefines 'close' to 'close_used_without_including_unistd_h'
in sys/socket.h if winsock2.h is present and unistd.h has not been
included before sys/socket.h. Reorder some includes to fix this.

src/conf/network_conf.c
src/remote/remote_driver.c
src/util/util.h

index ab76f21dd71ca61882cc438f91249dce411bd7e2..a64adf95c3b1811164042d20a001870e60c46b0c 100644 (file)
 
 #include <config.h>
 
+#include <unistd.h>
 #include <arpa/inet.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <dirent.h>
index 23fd0e3264972df363b4c74fd65e3a32b490fd07..be51366d4b454abc615bbd8848fb827148f4af97 100644 (file)
 
 #include <config.h>
 
-/* Windows socket compatibility functions. */
-#include <errno.h>
-#include <sys/socket.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#ifndef HAVE_WINSOCK2_H                /* Unix & Cygwin. */
+/* Windows socket compatibility functions. */
+#include <errno.h>
+#include <sys/socket.h>
+
+#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */
 # include <sys/un.h>
 # include <net/if.h>
 # include <netinet/in.h>
index 49b27f2cddb22cf2e4841a5b28f1d4faf7dd3e4f..d556daa4145136fea2a8de4a2bff9d67be9eb5ee 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "verify.h"
 #include "internal.h"
+#include <unistd.h>
 #include <sys/select.h>
 #include <sys/types.h>