]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix check of virKillProcess return status
authorDaniel P. Berrange <berrange@redhat.com>
Sat, 4 Jun 2011 10:05:28 +0000 (06:05 -0400)
committerDaniel P. Berrange <berrange@redhat.com>
Sat, 4 Jun 2011 11:26:07 +0000 (07:26 -0400)
The error code for virKillProcess is returned in the errno variable
not the return value. THis mistake caused the logs to be filled with
errors when shutting down QEMU processes

* src/qemu/qemu_process.c: Fix process kill check.

src/qemu/qemu_process.c

index f175d50823748e101be6b020fb924e5b3b4adaa1..faeeb9967a47891748e8b9b42ba4039b2c471a33 100644 (file)
@@ -2518,7 +2518,6 @@ cleanup:
 void qemuProcessKill(virDomainObjPtr vm)
 {
     int i;
-    int rc;
     VIR_DEBUG("vm=%s pid=%d", vm->def->name, vm->pid);
 
     if (!virDomainObjIsActive(vm)) {
@@ -2540,9 +2539,8 @@ void qemuProcessKill(virDomainObjPtr vm)
         else
             signum = 0; /* Just check for existence */
 
-        rc = virKillProcess(vm->pid, signum);
-        if (rc < 0) {
-            if (rc != -ESRCH) {
+        if (virKillProcess(vm->pid, signum) < 0) {
+            if (errno != ESRCH) {
                 char ebuf[1024];
                 VIR_WARN("Failed to kill process %d %s",
                          vm->pid, virStrerror(errno, ebuf, sizeof ebuf));