diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-06 19:46:35 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-06 19:46:35 +0000 |
commit | e863979dda2a2e9eca83f077674ea26e1c383c36 (patch) | |
tree | c088ca227887f031d719e873c3ccced8e817bd37 /ext/Sys | |
parent | 9a04b58aab23a90794a64e8dca421d8bdb03c1a6 (diff) | |
download | perl-e863979dda2a2e9eca83f077674ea26e1c383c36.tar.gz |
An unconditional carp is not nice.
p4raw-id: //depot/perl@19154
Diffstat (limited to 'ext/Sys')
-rw-r--r-- | ext/Sys/Syslog/Syslog.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 0f3c7ba6a9..2b283dbc81 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 { |