You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2008/09/23 12:16:51 UTC

svn commit: r698119 - /spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm

Author: jm
Date: Tue Sep 23 03:16:51 2008
New Revision: 698119

URL: http://svn.apache.org/viewvc?rev=698119&view=rev
Log:
bug 5985: avoid spurious 'message: error reading: Bad file descriptor' error during normal use

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm?rev=698119&r1=698118&r2=698119&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm Tue Sep 23 03:16:51 2008
@@ -269,11 +269,15 @@
   # NOTE: that "ref undef" works, so don't bother checking for a defined var
   # first.
   if (ref $self->{'raw'} eq 'GLOB') {
-    my @array;
     my $fd = $self->{'raw'};
     seek($fd, 0, 0)  or die "message: cannot rewind file: $!";
-    $! = 0; @array = <$fd>;
-    $!==0  or die "message: error reading: $!";
+    $! = 0;
+    my @array = <$fd>;
+    if ($! != 0) {
+      if (!$fd->eof()) {        # bug 5985: avoid spurious 'bad fd' error
+        die "message: error reading: $!";
+      }
+    }
     dbg("message: empty message read")  if !@array;
     return \@array;
   }