[PATCH] Fix virProcessKillPainfully on Win32

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Win32 platforms don't have SIGKILL defined, but they do have
SIGABRT. Since our virProcess wrapper treats anything which
isn't SIGTERM/SIGINT as equivalent to SIGKILL, just use
SIGABRT on Win32.

Pushed as a Win32 build break fix

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/virprocess.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index c70aa58..fee333f 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -267,8 +267,15 @@ virProcessKillPainfully(pid_t pid, bool force)
         } else if ((i == 50) & force) {
             VIR_DEBUG("Timed out waiting after SIGTERM to process %d, "
                       "sending SIGKILL", pid);
+            /* No SIGKILL kill on Win32 ! Use SIGABRT instead which our
+             * virProcessKill proc will handle more or less lik SIGKILL */
+#ifdef WIN32
+            signum = SIGABRT; /* kill it after a grace period */
+            signame = "ABRT";
+#else
             signum = SIGKILL; /* kill it after a grace period */
             signame = "KILL";
+#endif
         } else {
             signum = 0; /* Just check for existence */
         }
-- 
1.7.11.2

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