split old style pipe open call

This commit is contained in:
Wolfgang Bumiller 2016-06-09 16:54:46 +02:00 committed by Dietmar Maurer
parent 9a1c413f4b
commit 387ba25792

View File

@ -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;