This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
forked child may not exit correctly if it failed to open
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 28 Apr 2000 07:30:28 +0000 (07:30 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 28 Apr 2000 07:30:28 +0000 (07:30 +0000)
/dev/console (from Graham Barr)

p4raw-id: //depot/perl@5985

ext/Sys/Syslog/Syslog.pm

index d109a9d..95f89ce 100644 (file)
@@ -244,9 +244,9 @@ sub syslog {
            else {
                if (open(CONS,">/dev/console")) {
                    print CONS "<$facility.$priority>$whoami: $message\r";
-                   exit if defined $pid;               # if fork failed, we're parent
                    close CONS;
                }
+               exit if defined $pid;           # if fork failed, we're parent
            }
        }
     }