From: Gurusamy Sarathy Date: Fri, 3 Mar 2000 16:26:52 +0000 (+0000) Subject: /dev/console may not be writable in Syslog.pm (from Ask Bjoern Hansen X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa667c333c3281a1b59d5fc64f46b8083c726e0e;p=p5sagit%2Fp5-mst-13.2.git /dev/console may not be writable in Syslog.pm (from Ask Bjoern Hansen ) p4raw-id: //depot/perl@5489 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index b447374..17ebb37 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; + } } } }