summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-01-09 17:41:42 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-01-09 17:41:42 +0000
commit27f0ff3994bd695b050f978710988c685c0b6885 (patch)
tree19b17b439e848cb502a764720894390461a90b9b /usr.sbin
parent4b60b5b68132993226462b2877df1bfd16e2ee2c (diff)
with the intermediate gunzip gone, this is a simple pipe. No need for
separate handles to tweak.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm13
1 files 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 <espie@openbsd.org>
#
@@ -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);
}