summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-08-12 20:36:14 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-08-12 20:36:14 +0000
commitd5bc8d49c23a7bf4007175db326588f99b8e53d4 (patch)
tree259f95689430eb5444ce446541b534bbc7202623
parent936cbc0552da6fd0013242f8cb91ef9337d2459d (diff)
if we ask for cleanup, always close the location. If it's not open, it's
harmless. This prevents processes from piling up on !network addition of already existing packages... (fixes THAT bug)
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Handle.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Handle.pm b/usr.sbin/pkg_add/OpenBSD/Handle.pm
index ea7e06e7bd8..bdc992d347c 100644
--- a/usr.sbin/pkg_add/OpenBSD/Handle.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Handle.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Handle.pm,v 1.24 2010/07/31 11:17:22 espie Exp $
+# $OpenBSD: Handle.pm,v 1.25 2010/08/12 20:36:13 espie Exp $
#
# Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org>
#
@@ -38,12 +38,10 @@ sub cleanup
$self->{error} //= $error;
$self->{errorinfo} //= $errorinfo;
if (defined $self->location) {
- if (defined $self->{error}) {
- if ($self->{error} == BAD_PACKAGE) {
- $self->location->close_with_client_error;
- } else {
- $self->location->close_now;
- }
+ if (defined $self->{error} && $self->{error} == BAD_PACKAGE) {
+ $self->location->close_with_client_error;
+ } else {
+ $self->location->close_now;
}
$self->location->wipe_info;
}