mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
Output commandline on status != 0 in virCommandWait
This helps identifying which command exited with status != 0.
This commit is contained in:
parent
dad4a3f29a
commit
c7a6fc375a
@ -1221,9 +1221,11 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
|
|||||||
|
|
||||||
if (exitstatus == NULL) {
|
if (exitstatus == NULL) {
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
|
char *str = virCommandToString(cmd);
|
||||||
virCommandError(VIR_ERR_INTERNAL_ERROR,
|
virCommandError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Child process exited with status %d."),
|
_("Child process (%s) exited with status %d."),
|
||||||
WEXITSTATUS(status));
|
str ? str : cmd->args[0], WEXITSTATUS(status));
|
||||||
|
VIR_FREE(str);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user