]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util/virprocess.c: fix MinGW build
authorPavel Hrdina <phrdina@redhat.com>
Thu, 11 Sep 2014 12:51:48 +0000 (14:51 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 11 Sep 2014 13:16:02 +0000 (15:16 +0200)
The build failed because of missing "sys/syscall.h".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/util/virprocess.c

index 15d8309cc034becf3fb81f668e8812eb3082851a..3dae1bdf1f444291d25a95b941aeaa16d227a8b5 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <sys/syscall.h>
 #if HAVE_SETRLIMIT
 # include <sys/time.h>
 # include <sys/resource.h>
@@ -78,10 +77,21 @@ VIR_LOG_INIT("util.process");
 #endif
 
 #ifndef HAVE_SETNS
+# ifndef WIN32
+#  include <sys/syscall.h>
+
 static inline int setns(int fd, int nstype)
 {
     return syscall(__NR_setns, fd, nstype);
 }
+# else
+static inline int setns(int fd ATTRIBUTE_UNUSED, int nstype ATTRIBUTE_UNUSED)
+{
+    virReportSystemError(ENOSYS, "%s",
+                         _("Namespaces are not supported on windows."));
+    return -1;
+}
+# endif /* WIN32 */
 #endif /* HAVE_SETNS */
 
 /**