From 95815a3786bc584331bfa80d1b68b5de2b1ab420 Mon Sep 17 00:00:00 2001 From: espie Date: Thu, 9 Jan 2014 17:41:41 +0000 Subject: [PATCH] with the intermediate gunzip gone, this is a simple pipe. No need for separate handles to tweak. --- usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 8c7d4f9ce1e..83b5165e9f9 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.98 2014/01/09 10:43:13 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.99 2014/01/09 17:41:41 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -512,20 +512,12 @@ sub open_pipe $object->{cache_dir} = $ENV{'PKG_CACHE'}; $object->{parent} = $$; - my ($rdfh, $wrfh); - pipe($rdfh, $wrfh); - - my $pid2 = fork(); - + my $pid2 = open(my $rdfh, "-|"); $self->did_it_fork($pid2); if ($pid2) { $object->{pid2} = $pid2; } else { open STDERR, '>', $object->{errors}; - open(STDOUT, '>&', $wrfh) or - $self->{state}->fatal("Bad dup: #1", $!); - close($rdfh); - close($wrfh); if (defined $object->{cache_dir}) { my $pid3 = open(my $in, "-|"); $self->did_it_fork($pid3); @@ -539,7 +531,6 @@ sub open_pipe } exit(0); } - close($wrfh); return $self->uncompress($rdfh); } -- 2.20.1