summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-06-14 16:59:46 +0000
committerPeter Palfrader <peter@palfrader.org>2004-06-14 16:59:46 +0000
commite8683a54e9a204e92db3823b228fb8308f6b3a61 (patch)
treedf9f18882b86af6f35e48f6977fe5fe8b45af5db /Echolot
parent169b3cc1a13afa778aaaedd721cbab7e807b2d74 (diff)
Fix that check for syswrite's return value
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Tools.pm9
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.");