summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
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)" );