From: espie Date: Mon, 27 Jun 2016 08:38:15 +0000 (+0000) Subject: surprised nobody noticed before me X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7b25c30a10046a118d58c9023c4c99a927530d9f;p=openbsd surprised nobody noticed before me let scp:// work with PKG_CACHE basically, we do an extra fork, so we end up cleaning up the connection twice that's okay for the handles, but not for the commands, since we do a spurious ABORT BYE BYE on cleanup. --- diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 209c8c93252..45e84248239 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.123 2016/04/25 10:53:13 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.124 2016/06/27 08:38:15 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -87,6 +87,10 @@ sub parse_fullurl return $class->unique($class->parse_url($r, $state)); } +sub dont_cleanup +{ +} + sub ftp() { 'OpenBSD::PackageRepository::FTP' } sub http() { 'OpenBSD::PackageRepository::HTTP' } sub https() { 'OpenBSD::PackageRepository::HTTPS' } @@ -550,6 +554,7 @@ sub open_pipe my $pid3 = open(my $in, "-|"); $self->did_it_fork($pid3); if ($pid3) { + $self->dont_cleanup; $self->pkg_copy($in, $object); } else { $self->grab_object($object); diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistent.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistent.pm index 4df2556a58c..9b8b03cfc02 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistent.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistent.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Persistent.pm,v 1.1 2014/08/27 18:40:03 kspillner Exp $ +# $OpenBSD: Persistent.pm,v 1.2 2016/06/27 08:38:15 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -129,9 +129,18 @@ sub cleanup CORE::close($cmdfh); CORE::close($getfh); waitpid($self->{controller}, 0); + delete $self->{controller}; } } +sub dont_cleanup +{ + my $self = shift; + CORE::close($self->{cmdfh}); + CORE::close($self->{getfh}); + delete $self->{controller}; +} + sub reinitialize { my $self = shift;