From: Mark J. Reed Date: Fri, 15 Dec 2000 21:22:29 +0000 (-0500) Subject: [ID 20001215.004] Sys::Syslog::xlate doesn't handle LOG_EMERG X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c3b42a16897eb950a4ce4071f148e2e7bfac3a3;p=p5sagit%2Fp5-mst-13.2.git [ID 20001215.004] Sys::Syslog::xlate doesn't handle LOG_EMERG Message-Id: <200012160222.VAA13986@strange.turner.com> p4raw-id: //depot/perl@8193 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 92b82a1..71f5b82 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -264,7 +264,9 @@ sub xlate { $name = uc $name; $name = "LOG_$name" unless $name =~ /^LOG_/; $name = "Sys::Syslog::$name"; - eval { &$name } || -1; + # Can't have just eval { &$name } || -1 because some LOG_XXX may be zero. + my $value = eval { &$name }; + defined $value ? $value : -1; } sub connect {