split old style pipe open call

This commit is contained in:
Wolfgang Bumiller 2016-06-09 16:54:36 +02:00 committed by Dietmar Maurer
parent c2625f1052
commit efef9eb295

View File

@ -4750,11 +4750,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;