mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-01-11 05:17:57 +03:00
fix some FH close
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
41af2dfc25
commit
808a65b522
@ -1157,11 +1157,11 @@ my $kvm_api_version = 0;
|
|||||||
sub kvm_version {
|
sub kvm_version {
|
||||||
return $kvm_api_version if $kvm_api_version;
|
return $kvm_api_version if $kvm_api_version;
|
||||||
|
|
||||||
open my $fh, '<', '/dev/kvm'
|
open my $fh, '<', '/dev/kvm' or return;
|
||||||
or return;
|
|
||||||
|
|
||||||
# 0xae00 => KVM_GET_API_VERSION
|
# 0xae00 => KVM_GET_API_VERSION
|
||||||
$kvm_api_version = ioctl($fh, 0xae00, 0);
|
$kvm_api_version = ioctl($fh, 0xae00, 0);
|
||||||
|
close($fh);
|
||||||
|
|
||||||
return $kvm_api_version;
|
return $kvm_api_version;
|
||||||
}
|
}
|
||||||
@ -6244,10 +6244,7 @@ sub restore_vma_archive {
|
|||||||
my $mapfifo = "/var/tmp/vzdumptmp$$.fifo";
|
my $mapfifo = "/var/tmp/vzdumptmp$$.fifo";
|
||||||
POSIX::mkfifo($mapfifo, 0600);
|
POSIX::mkfifo($mapfifo, 0600);
|
||||||
my $fifofh;
|
my $fifofh;
|
||||||
|
my $openfifo = sub { open($fifofh, '>', $mapfifo) or die $! };
|
||||||
my $openfifo = sub {
|
|
||||||
open($fifofh, '>', $mapfifo) || die $!;
|
|
||||||
};
|
|
||||||
|
|
||||||
$add_pipe->(['vma', 'extract', '-v', '-r', $mapfifo, $readfrom, $tmpdir]);
|
$add_pipe->(['vma', 'extract', '-v', '-r', $mapfifo, $readfrom, $tmpdir]);
|
||||||
|
|
||||||
@ -6372,6 +6369,7 @@ sub restore_vma_archive {
|
|||||||
$oldtimeout = undef;
|
$oldtimeout = undef;
|
||||||
alarm($tmp);
|
alarm($tmp);
|
||||||
close($fifofh);
|
close($fifofh);
|
||||||
|
$fifofh = undef;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6384,6 +6382,7 @@ sub restore_vma_archive {
|
|||||||
|
|
||||||
$restore_deactivate_volumes->($cfg, $devinfo);
|
$restore_deactivate_volumes->($cfg, $devinfo);
|
||||||
|
|
||||||
|
close($fifofh) if $fifofh;
|
||||||
unlink $mapfifo;
|
unlink $mapfifo;
|
||||||
rmtree $tmpdir;
|
rmtree $tmpdir;
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ sub diff($$) {
|
|||||||
my $ha = IO::Handle->new_from_fd($wa, 'w');
|
my $ha = IO::Handle->new_from_fd($wa, 'w');
|
||||||
my $hb = IO::Handle->new_from_fd($wb, 'w');
|
my $hb = IO::Handle->new_from_fd($wb, 'w');
|
||||||
|
|
||||||
open my $diffproc, '-|', 'diff', '-up', "/proc/self/fd/$ra", "/proc/self/fd/$rb"
|
open my $diffproc, '-|', 'diff', '-up', "/proc/self/fd/$ra", "/proc/self/fd/$rb" ## no critic
|
||||||
or die "failed to run program 'diff': $!";
|
or die "failed to run program 'diff': $!";
|
||||||
POSIX::close($ra);
|
POSIX::close($ra);
|
||||||
POSIX::close($rb);
|
POSIX::close($rb);
|
||||||
|
Loading…
Reference in New Issue
Block a user