This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Sys::Syslog blows up rather spectacularly on Solaris
authorAlan Burlison <Alan.Burlison@uk.sun.com>
Tue, 10 Jan 2006 15:51:42 +0000 (15:51 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 10 Jan 2006 16:59:25 +0000 (16:59 +0000)
Message-ID: <43C3D80E.20704@sun.com>
Date: Tue, 10 Jan 2006 15:51:42 +0000

p4raw-id: //depot/perl@26773

ext/Sys/Syslog/Syslog.pm
ext/Sys/Syslog/t/constants.t

index c9accd3..5974266 100644 (file)
@@ -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");
index 1195068..d7c7b0c 100644 (file)
@@ -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)" );