From c5b8f52451a60d015e8540b8f79bf4e0f195fc43 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 14 Jun 2004 13:45:16 +0000 Subject: Check if syswrite's return value is defined --- Echolot/Tools.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Echolot') diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm index 157a61a..d1a10a2 100644 --- a/Echolot/Tools.pm +++ b/Echolot/Tools.pm @@ -325,6 +325,9 @@ sub readwrite_gpg($$$$$) { for my $wfd (@$readyw) { Echolot::Log::trace("writing to $wfd."); $written = $wfd->syswrite($in, length($in) - $offset, $offset); + defined ($written) or + Echolot::Log::warn("Error while writing to GnuPG: $!"), + next; $offset += $written; if ($offset == length($in)) { Echolot::Log::trace("writing to $wfd done."); -- cgit v1.2.3