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 2005/08/20 05:04:34 UTC

svn commit: r233992 - /spamassassin/branches/3.1/spamassassin.raw

Author: jm
Date: Fri Aug 19 20:04:33 2005
New Revision: 233992

URL: http://svn.apache.org/viewcvs?rev=233992&view=rev
Log:
bug 4536: avoid breakage if a warn happens before Mail::SA::Logger is loaded

Modified:
    spamassassin/branches/3.1/spamassassin.raw

Modified: spamassassin/branches/3.1/spamassassin.raw
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/spamassassin.raw?rev=233992&r1=233991&r2=233992&view=diff
==============================================================================
--- spamassassin/branches/3.1/spamassassin.raw (original)
+++ spamassassin/branches/3.1/spamassassin.raw Fri Aug 19 20:04:33 2005
@@ -28,10 +28,6 @@
 use lib '@@INSTALLSITELIB@@';                   # substituted at 'make' time
 
 BEGIN {
-  # redirect __WARN__ and __DIE__
-  $SIG{__WARN__} = sub {
-    log_message("warn", $_[0]);
-  };
   # Locate locally installed SA libraries *without* using FindBin, which
   # generates warnings and causes more trouble than its worth.  We don't
   # need to be too smart about this BTW.
@@ -82,6 +78,14 @@
 use Mail::SpamAssassin::ArchiveIterator;
 use Mail::SpamAssassin::Util::Progress;
 use Mail::SpamAssassin::Logger qw(log_message);
+
+BEGIN {
+  # redirect __WARN__ and __DIE__, but NOT until after the
+  # Mail::SpamAssassin::Logger class has been parsed.
+  $SIG{__WARN__} = sub {
+    log_message("warn", $_[0]);
+  };
+};
 
 my %resphash = (
   EX_OK          => 0,     # no problems