Re: [PATCH] util/virprocess.c: fix MinGW build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/11/2014 03:03 PM, Peter Krempa wrote:
Subject doesn't describe what caused the build to fail.

On 09/11/14 14:57, Pavel Hrdina wrote:

Neither the rest of the commit message.

The build failed because of missing "sys/syscall.h".

Will update the commit message, thanks.


Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
  src/util/virprocess.c | 12 +++++++++++-
  1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 15d8309..3dae1bd 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -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

Is this set on the windows build? That's strange. Shouldn't we fix the
make system to avoid it?


This is a workaround if the HAVE_SETNS is not defined because old glibc may not have a wrapper for this syscall. And it obviously isn't defined for windows.

Pavel

+# 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 */

  /**


Peter


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]