From: Jarkko Hietaniemi Date: Sun, 6 Apr 2003 19:46:35 +0000 (+0000) Subject: An unconditional carp is not nice. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e863979dda2a2e9eca83f077674ea26e1c383c36;p=p5sagit%2Fp5-mst-13.2.git An unconditional carp is not nice. p4raw-id: //depot/perl@19154 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 0f3c7ba..2b283db 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -194,7 +194,7 @@ sub setlogsock { } elsif (lc($setsock) eq 'stream') { unless (defined $syslog_path) { my @try = qw(/dev/log /dev/conslog); - if (length &_PATH_LOG) { + if (length &_PATH_LOG) { # Undefined _PATH_LOG is "". unshift @try, &_PATH_LOG; } for my $try (@try) { @@ -203,9 +203,10 @@ sub setlogsock { last; } } - carp "stream passed to setlogsock, but could not find any device"; + carp "stream passed to setlogsock, but could not find any device" + unless defined $syslog_path; } - if (!-w $syslog_path) { + unless (-w $syslog_path) { carp "stream passed to setlogsock, but $syslog_path is not writable"; return undef; } else {