5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-08 01:17:37 +03:00

tools: download_file_from_url: handle interrupts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-15 14:20:49 +02:00
parent 60fb1c2628
commit 3a94648515

View File

@ -1865,6 +1865,11 @@ sub download_file_from_url {
}
}
local $SIG{INT} = sub {
unlink $tmpdest or warn "could not cleanup temporary file: $!";
die "got interrupted by signal\n";
};
{ # limit the scope of the ENV change
local %ENV;
if ($opts->{http_proxy}) {