diff options
author | Peter Palfrader <peter@palfrader.org> | 2004-06-14 16:59:46 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2004-06-14 16:59:46 +0000 |
commit | e8683a54e9a204e92db3823b228fb8308f6b3a61 (patch) | |
tree | df9f18882b86af6f35e48f6977fe5fe8b45af5db | |
parent | 169b3cc1a13afa778aaaedd721cbab7e807b2d74 (diff) |
Fix that check for syswrite's return value
-rw-r--r-- | Echolot/Tools.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm index d1a10a2..425180c 100644 --- a/Echolot/Tools.pm +++ b/Echolot/Tools.pm @@ -325,9 +325,12 @@ 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; + unless (defined ($written)) { + Echolot::Log::warn("Error while writing to GnuPG: $!"); + close $wfd; + $sin->remove($wfd); + $sin = undef; + }; $offset += $written; if ($offset == length($in)) { Echolot::Log::trace("writing to $wfd done."); |