summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-01-30 13:18:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-01-30 13:18:35 +0000
commit2106ecce9df1aeb1b0598fde33a7de2b296517db (patch)
tree9c99ca4a7cc138ac1036ede1a80bea35586ebb32 /usr.sbin/pkg_add
parent42baa90b3850cccea2cf41e85903bf2c6dbf9b0f (diff)
don't save empty errors
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Handle.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Handle.pm b/usr.sbin/pkg_add/OpenBSD/Handle.pm
index 67a7d2b51e3..fa76778c234 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.31 2013/12/08 12:14:41 espie Exp $
+# $OpenBSD: Handle.pm,v 1.32 2014/01/30 13:18:34 espie Exp $
#
# Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org>
#
@@ -38,8 +38,10 @@ sub is_real { return 1; }
sub cleanup
{
my ($self, $error, $errorinfo) = @_;
- $self->{error} //= $error;
- $self->{errorinfo} //= $errorinfo;
+ if (defined $error) {
+ $self->{error} //= $error;
+ $self->{errorinfo} //= $errorinfo;
+ }
if (defined $self->location) {
if (defined $self->{error} && $self->{error} == BAD_PACKAGE) {
$self->location->close_with_client_error;