diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-03 16:26:52 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-03 16:26:52 +0000 |
commit | aa667c333c3281a1b59d5fc64f46b8083c726e0e (patch) | |
tree | 2e8d0a971efe2e50fdb5d015298c97427b47604d /ext/Sys | |
parent | 403d6f8e894056e673725f16d00d471c48c44dd2 (diff) | |
download | perl-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.pm | 9 |
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; + } } } } |