in reply to Re: fork() && exit;
in thread fork() && exit;
Bzzzt! That should read:my $PID = fork(); if ($PID) { # in the parent process } else { # in the child process }
Always, always, always check the return values of your system calls. And that includes fork.my $PID = fork(); if ($PID) { # in the parent process } else { # in either the child process or the parent # process, depending on whether the fork() # succeeded or failed. }
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: fork() && exit;
by stvn (Monsignor) on Feb 23, 2004 at 17:09 UTC |