mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 13:13:24 +00:00
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>
This commit is contained in:
parent
86b8423739
commit
38d9aa1247
@ -341,7 +341,7 @@ sub run_command {
|
||||
my $timeout;
|
||||
my $oldtimeout;
|
||||
my $pid;
|
||||
my $exitcode;
|
||||
my $exitcode = -1;
|
||||
|
||||
my $outfunc;
|
||||
my $errfunc;
|
||||
|
Loading…
Reference in New Issue
Block a user