]> git.proxmox.com Git - pve-common.git/commit
run_command: default exit code to -1
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 5 Apr 2017 09:35:53 +0000 (11:35 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 10 Apr 2017 12:50:13 +0000 (14:50 +0200)
commit38d9aa124702d61eed5a3b4d054e5a17e64110ef
tree0db89cc7a0df204d4d89e9f90c4f364575217368
parent86b8423739ccac26a115625bc002d6ef51d17a52
run_command: default exit code to -1

When the child process running the command got  an signal or failed
to execute exitcode was still undefined as we extract it just only
after the signal/failed to execute check.
This led to:
 > Use of uninitialized value in numeric ne (!=) at
 > /usr/share/perl5/PVE/API2/Qemu.pm line 1433.
errors if we used run_commands `noerr` param and checked for the
commands exit code.

So just default the exit code to -1 for such cases.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Tools.pm