Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: Understanding fork

by neilwatson (Priest)
on Nov 08, 2002 at 17:38 UTC ( #211484=note: print w/replies, xml ) Need Help??

in reply to Re: Understanding fork
in thread Understanding fork

In the parent process, fork() returns the process ID of the new child. So in that process, you redirect the user, and exit. (At least, I THINK you should exit, but you're falling out of that else clause in your sample, and doing the while twice...).

How do you prevent that?

Neil Watson

Replies are listed 'Best First'.
Re: Re: Re: Understanding fork
by RMGir (Prior) on Nov 08, 2002 at 18:21 UTC
    Where you have the comment about redirecting the user, add
    $SIG{CHLD}='IGNORE'; exit;
    That way, the parent process will exit immediately, hopefully without waiting for the child process.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://211484]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-08-15 07:28 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (78 votes). Check out past polls.