From aa667c333c3281a1b59d5fc64f46b8083c726e0e Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Fri, 3 Mar 2000 16:26:52 +0000 Subject: /dev/console may not be writable in Syslog.pm (from Ask Bjoern Hansen ) p4raw-id: //depot/perl@5489 --- ext/Sys/Syslog/Syslog.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ext') 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; + } } } } -- cgit v1.2.1