diff options
author | Mark J. Reed <mreed@strange.turner.com> | 2000-12-15 16:22:29 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-19 17:10:57 +0000 |
commit | 2c3b42a16897eb950a4ce4071f148e2e7bfac3a3 (patch) | |
tree | 0cd79f2e38e5c32ae9f70f5fbd8d0c6566f219cf /ext/Sys | |
parent | 85b81d9324253120bb12a49711cc05ad5949da8e (diff) | |
download | perl-2c3b42a16897eb950a4ce4071f148e2e7bfac3a3.tar.gz |
[ID 20001215.004] Sys::Syslog::xlate doesn't handle LOG_EMERG
Message-Id: <200012160222.VAA13986@strange.turner.com>
p4raw-id: //depot/perl@8193
Diffstat (limited to 'ext/Sys')
-rw-r--r-- | ext/Sys/Syslog/Syslog.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 92b82a1acd..71f5b828d0 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 { |