5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

kill socat if we do not get any connection within $timeout seconds

This commit is contained in:
Dietmar Maurer 2013-06-25 14:34:59 +02:00
parent d914737577
commit eb15737004

View File

@ -1411,7 +1411,13 @@ __PACKAGE__->register_method({
}
};
eval { PVE::Tools::run_command($cmd, errfunc => $parser, outfunc => sub{}); };
eval {
# kill socat if we do not get any connection within $timeout seconds
local $SIG{ALRM} = sub { die "got timeout\n" if $conn_count <= 0; };
alarm($timeout);
PVE::Tools::run_command($cmd, errfunc => $parser, outfunc => sub{});
};
if (my $err = $@) {
die $err if $err !~ m/client exit$/;
}