summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2019-07-07 12:42:55 +0000
committerMarc Espie <espie@cvs.openbsd.org>2019-07-07 12:42:55 +0000
commit6bce6cb0a15bed9387f31a35a4faa59203db66f6 (patch)
tree66b5c2bc4efaea4108e1c1a7245c12c60d792dbd /usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
parentd347f60944e664e5209e92c4729878d113dc8fbf (diff)
use last_error
fix again tmpfile so that it fails as it should
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 0516f9d9e71..f20a666c9b9 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.161 2019/07/03 12:51:02 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.162 2019/07/07 12:42:54 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -37,8 +37,7 @@ sub make_error_file
my ($self, $object) = @_;
$object->{errors} = OpenBSD::Temp->file;
if (!defined $object->{errors}) {
- $self->{state}->fatal("#1 not writable",
- $OpenBSD::Temp::tempbase);
+ $self->{state}->fatal(OpenBSD::Temp->last_error);
}
}
@@ -641,7 +640,8 @@ sub pkg_copy
my $name = $object->{name};
my $dir = $object->{cache_dir};
- my ($copy, $filename) = OpenBSD::Temp::permanent_file($dir, $name) or die "Can't write copy to cache";
+ my ($copy, $filename) = OpenBSD::Temp::permanent_file($dir, $name) or
+ $self->{state}->fatal(OpenBSD::Temp->last_error);
chmod((0666 & ~umask), $filename);
$object->{tempname} = $filename;
my $handler = sub {