summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorSébastien Aperghis-Tramoni <sebastien@aperghis.net>2007-11-05 09:48:53 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-11-05 10:19:31 +0000
commit26f266f7047990be53d6e87dc63daa4109444b3e (patch)
treebebb8f62c2cb59ecab6508a54abc971964faab04 /ext/Sys
parent35a209d11010ccd56ab11d21f8c2a8bdee2ea914 (diff)
downloadperl-26f266f7047990be53d6e87dc63daa4109444b3e.tar.gz
Another small patch for Sys::Syslog
Message-Id: <A5B536D9-E81C-48FC-9584-45E59ED7B6FB@free.fr> p4raw-id: //depot/perl@32222
Diffstat (limited to 'ext/Sys')
-rw-r--r--ext/Sys/Syslog/Changes2
-rw-r--r--ext/Sys/Syslog/Syslog.pm21
2 files changed, 15 insertions, 8 deletions
diff --git a/ext/Sys/Syslog/Changes b/ext/Sys/Syslog/Changes
index 2ad59565b5..061bf9b20b 100644
--- a/ext/Sys/Syslog/Changes
+++ b/ext/Sys/Syslog/Changes
@@ -1,6 +1,8 @@
Revision history for Sys-Syslog
0.22 -- 2007.11.xx -- Sebastien Aperghis-Tramoni (SAPER)
+ [BUGFIX] CPAN-RT#29875: Added workaround SpamAssassin overzealous
+ logging features.
[FEATURE] Added support for PERROR option.
[FEATURE] Support for SYSLOG on z/OS, thanks to Chun Bing Ge.
[CODE] Prevent $@ from being visible outside the module, in trying
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index 2a86283179..3aa26a3a5d 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -105,16 +105,21 @@ if ($^O =~ /^(freebsd|linux)$/) {
@connectMethods = grep { $_ ne 'udp' } @connectMethods;
}
-# use EventLog on Win32
-my $is_Win32 = $^O =~ /Win32/i;
+EVENTLOG: {
+ # use EventLog on Win32
+ my $is_Win32 = $^O =~ /Win32/i;
-if (eval "use Sys::Syslog::Win32; 1") {
- unshift @connectMethods, 'eventlog';
-} elsif ($is_Win32) {
- warn $@;
-}
+ # some applications are trying to be too smart
+ # yes I'm speaking of YOU, SpamAssassin, grr..
+ local($SIG{__DIE__}, $SIG{__WARN__}, $@);
-$@ = "";
+ if (eval "use Sys::Syslog::Win32; 1") {
+ unshift @connectMethods, 'eventlog';
+ }
+ elsif ($is_Win32) {
+ warn $@;
+ }
+}
my @defaultMethods = @connectMethods;
my @fallbackMethods = ();