diff options
author | Steven Mestdagh <steven@cvs.openbsd.org> | 2006-05-26 17:12:10 +0000 |
---|---|---|
committer | Steven Mestdagh <steven@cvs.openbsd.org> | 2006-05-26 17:12:10 +0000 |
commit | ef6e2c33de8ada559570336e3b8f13300a6c93ae (patch) | |
tree | 18176929b32438085dc8c3f0a768de462d864655 /usr.sbin/pkg_add/OpenBSD/PackageRepository | |
parent | 1ea23f97b9a6fd2a55e649fe34b447a8e664227f (diff) |
make pkg_add exit gracefully if it cannot read from a file handle, which
happens when the ssh connection could not be established.
ok espie@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm index dd2864891b7..cc37e48fb44 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.8 2006/03/13 16:08:12 espie Exp $ +# $OpenBSD: SCP.pm,v 1.9 2006/05/26 17:12:09 steven Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -135,6 +135,9 @@ sub list print $cmdfh "LIST $path\n"; local $_; $_ = <$getfh>; + if (!defined $_) { + die "Could not initiate SSH session\n"; + } chomp; if (m/^ERROR:/) { die $_; |