]> xenbits.xensource.com Git - libvirt.git/commitdiff
Output commandline on status != 0 in virCommandWait
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 15 Feb 2011 10:46:16 +0000 (11:46 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 15 Feb 2011 10:46:16 +0000 (11:46 +0100)
This helps identifying which command exited with status != 0.

src/util/command.c

index abd2dc4ae4d4823d55a5c1702ec9a8cb015937ad..258dc138e8a2b22f5ba14d1c52e46a7efc297317 100644 (file)
@@ -1221,9 +1221,11 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
 
     if (exitstatus == NULL) {
         if (status != 0) {
+            char *str = virCommandToString(cmd);
             virCommandError(VIR_ERR_INTERNAL_ERROR,
-                            _("Child process exited with status %d."),
-                            WEXITSTATUS(status));
+                            _("Child process (%s) exited with status %d."),
+                            str ? str : cmd->args[0], WEXITSTATUS(status));
+            VIR_FREE(str);
             return -1;
         }
     } else {