]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix virProcessKillPainfully on Win32
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Oct 2012 14:46:12 +0000 (15:46 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Oct 2012 14:47:14 +0000 (15:47 +0100)
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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virprocess.c

index c70aa58dbb2076aa356330c55e2bf9b9df3f7853..fee333f64deb28a5959d0cf9c3760bbce1980dd0 100644 (file)
@@ -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 */
         }