diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2016-06-27 08:38:16 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2016-06-27 08:38:16 +0000 |
commit | b7a22a47f3079e4e75f4cc48d0babb84b49c7c83 (patch) | |
tree | 682e35dd6543d5bf9b2af39ebc321c20067a28e8 /usr.sbin | |
parent | 65758b15bed08a108067869792fb0997e81a9b9b (diff) |
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository/Persistent.pm | 11 |
2 files changed, 16 insertions, 2 deletions
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 <espie@openbsd.org> # @@ -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 <espie@openbsd.org> # @@ -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; |