mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-02 15:03:45 +00:00
split old style pipe open call
This commit is contained in:
parent
9a1c413f4b
commit
387ba25792
@ -4957,11 +4957,11 @@ sub tar_archive_read_firstfile {
|
||||
die "ERROR: file '$archive' does not exist\n" if ! -f $archive;
|
||||
|
||||
# try to detect archive type first
|
||||
my $pid = open (TMP, "tar tf '$archive'|") ||
|
||||
my $pid = open (my $fh, '-|', 'tar', 'tf', $archive) ||
|
||||
die "unable to open file '$archive'\n";
|
||||
my $firstfile = <TMP>;
|
||||
my $firstfile = <$fh>;
|
||||
kill 15, $pid;
|
||||
close TMP;
|
||||
close $fh;
|
||||
|
||||
die "ERROR: archive contaions no data\n" if !$firstfile;
|
||||
chomp $firstfile;
|
||||
|
Loading…
Reference in New Issue
Block a user