summaryrefslogtreecommitdiff
path: root/ext/Sys
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-03 16:26:52 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-03 16:26:52 +0000
commitaa667c333c3281a1b59d5fc64f46b8083c726e0e (patch)
tree2e8d0a971efe2e50fdb5d015298c97427b47604d /ext/Sys
parent403d6f8e894056e673725f16d00d471c48c44dd2 (diff)
downloadperl-aa667c333c3281a1b59d5fc64f46b8083c726e0e.tar.gz
/dev/console may not be writable in Syslog.pm (from Ask Bjoern Hansen
<ask@valueclick.com>) p4raw-id: //depot/perl@5489
Diffstat (limited to 'ext/Sys')
-rw-r--r--ext/Sys/Syslog/Syslog.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index b4473744c5..17ebb379c6 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -242,10 +242,11 @@ sub syslog {
}
}
else {
- open(CONS,">/dev/console");
- print CONS "<$facility.$priority>$whoami: $message\r";
- exit if defined $pid; # if fork failed, we're parent
- close CONS;
+ if (open(CONS,">/dev/console")) {
+ print CONS "<$facility.$priority>$whoami: $message\r";
+ exit if defined $pid; # if fork failed, we're parent
+ close CONS;
+ }
}
}
}