summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-04-06 19:46:35 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-04-06 19:46:35 +0000
commite863979dda2a2e9eca83f077674ea26e1c383c36 (patch)
treec088ca227887f031d719e873c3ccced8e817bd37 /ext/Sys
parent9a04b58aab23a90794a64e8dca421d8bdb03c1a6 (diff)
downloadperl-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.pm7
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 {