From: Alan Burlison Date: Tue, 10 Jan 2006 15:51:42 +0000 (+0000) Subject: Re: Sys::Syslog blows up rather spectacularly on Solaris X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=71cedc6d5edb73a8e9122dd411eab6a5cb2978b9;p=p5sagit%2Fp5-mst-13.2.git Re: Sys::Syslog blows up rather spectacularly on Solaris Message-ID: <43C3D80E.20704@sun.com> Date: Tue, 10 Jan 2006 15:51:42 +0000 p4raw-id: //depot/perl@26773 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index c9accd3..5974266 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -916,6 +916,10 @@ sub connect_unix { push(@{$errs}, "_PATH_LOG not available in syslog.h"); return 0; } + if (! -S $syslog_path) { + push(@{$errs}, "$syslog_path is not a socket"); + return 0; + } my $that = sockaddr_un($syslog_path); if (!$that) { push(@{$errs}, "can't locate $syslog_path"); diff --git a/ext/Sys/Syslog/t/constants.t b/ext/Sys/Syslog/t/constants.t index 1195068..d7c7b0c 100644 --- a/ext/Sys/Syslog/t/constants.t +++ b/ext/Sys/Syslog/t/constants.t @@ -27,7 +27,7 @@ if(@names) { $name = $1; my $v = eval "${callpack}::$name()"; - if($v =~ /^\d+$/) { + if(defined($v) && $v =~ /^\d+$/) { is( $@, '', "calling the constant $name as a function" ); like( $v, '/^\d+$/', "checking that $name is a number ($v)" );