in reply to Re: Re: Waitpid Woes
in thread Waitpid Woes

No, the same parent is forking both children. When you say 'if (fork)', the code in the first part of the if is the parent code, the part in the 'else' is the child.

Replies are listed 'Best First'.
Re: Re: Re: Re: Waitpid Woes
by suaveant (Parson) on Dec 17, 2003 at 19:40 UTC
    Duh.

    Doesn't solve my real problem, but solves my test problem, thanks.

                    - Ant
                    - Some of my best work - (1 2 3)

      Not sure this helps, but the only time I've seen waitpid return -1 (aka 255) when it should have returned something useful was when I was mixing it with perl's builtin backticks/system()/rx() which reap children themselves (i.e. one starts reaping children it's not responsible for).
        return from waitpid, or the value in $? not backticking... and I am getting back the pids I expect, so I doubt they are being reaped somewhere else...

                        - Ant
                        - Some of my best work - (1 2 3)