summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm
index 4fcd8924a92..c0de7177b8b 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: SCP.pm,v 1.23 2010/06/30 10:51:04 espie Exp $
+# $OpenBSD: SCP.pm,v 1.24 2010/07/02 11:50:50 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -82,7 +82,7 @@ sub grab_object
$_ = <$getfh>;
chomp;
if (m/^ERROR:/o) {
- die "transfer error: $_";
+ $self->{state}->fatal("transfer error: #1", $_);
}
if (m/^TRANSFER:\s+(\d+)/o) {
my $buffsize = 10 * 1024;
@@ -95,7 +95,7 @@ sub grab_object
$n = read($getfh, $buffer,
$remaining < $buffsize ? $remaining :$buffsize);
if (!defined $n) {
- die "Error reading\n";
+ $self->{state}->fatal("Error reading: #1", $!);
}
$remaining -= $n;
if ($n > 0) {
@@ -136,14 +136,14 @@ sub list
my $_;
$_ = <$getfh>;
if (!defined $_) {
- die "Could not initiate SSH session\n";
+ $self->{state}->fatal("Could not initiate SSH session");
}
chomp;
if (m/^ERROR:/o) {
- die $_;
+ $self->{state}->fatal("#1", $_);
}
if (!m/^SUCCESS:/o) {
- die "Synchronization error\n";
+ $self->{state}->fatal("Synchronization error");
}
while (<$getfh>) {
chomp;