From efef9eb29527a8abd8872f488891ca5aa15c4ee1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 9 Jun 2016 16:54:36 +0200 Subject: [PATCH] split old style pipe open call --- PVE/QemuServer.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6279e048..48df3543 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -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 = ; + my $firstfile = <$fh>; kill 15, $pid; - close TMP; + close $fh; die "ERROR: archive contaions no data\n" if !$firstfile; chomp $firstfile;