[PATCH] Disable virCommandExec on Win32

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

 



Mingw execve() has a broken signature. Disable this
function until gnulib fixes the signature, since we
don't really need this on Win32 anyway.

* src/util/command.c: Disable virCommandExec on Win32
---
 src/util/command.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/util/command.c b/src/util/command.c
index 7ac411b..ebb90cb 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -989,6 +989,7 @@ cleanup:
  * Returns -1 on any error executing the command.
  * Will not return on success.
  */
+#ifndef WIN32
 int virCommandExec(virCommandPtr cmd)
 {
     if (!cmd ||cmd->has_error == ENOMEM) {
@@ -1003,6 +1004,18 @@ int virCommandExec(virCommandPtr cmd)
 
     return execve(cmd->args[0], cmd->args, cmd->env);
 }
+#else
+int virCommandExec(virCommandPtr cmd ATTRIBUTE_UNUSED)
+{
+    /* Mingw execve() has a broken signature. Disable this
+     * function until gnulib fixes the signature, since we
+     * don't really need this on Win32 anyway.
+     */
+    virReportSystemError(ENOSYS, "%s",
+                         _("Executing new processes is not supported on Win32 platform"));
+    return -1;
+}
+#endif
 
 /*
  * Run the command and wait for completion.
-- 
1.7.4.4

--
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]