From: Sébastien Aperghis-Tramoni Date: Mon, 5 Nov 2007 08:48:53 +0000 (+0100) Subject: Another small patch for Sys::Syslog X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26f266f7047990be53d6e87dc63daa4109444b3e;p=p5sagit%2Fp5-mst-13.2.git Another small patch for Sys::Syslog Message-Id: p4raw-id: //depot/perl@32222 --- diff --git a/ext/Sys/Syslog/Changes b/ext/Sys/Syslog/Changes index 2ad5956..061bf9b 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 2a86283..3aa26a3 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 = ();