summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorAlan Burlison <Alan.Burlison@uk.sun.com>2006-01-10 15:51:42 +0000
committerNicholas Clark <nick@ccl4.org>2006-01-10 16:59:25 +0000
commit71cedc6d5edb73a8e9122dd411eab6a5cb2978b9 (patch)
treed145559d0b9ac1e24784aca0cff84b250e25b3a3 /ext/Sys
parent807d24c827c4cbd2046888817a0509dd8c4b593a (diff)
downloadperl-71cedc6d5edb73a8e9122dd411eab6a5cb2978b9.tar.gz
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
Diffstat (limited to 'ext/Sys')
-rw-r--r--ext/Sys/Syslog/Syslog.pm4
-rw-r--r--ext/Sys/Syslog/t/constants.t2
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index c9accd3159..5974266da2 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 11950687b2..d7c7b0c7df 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)" );