in reply to forking and timeouts

The test in the sub is suspect:
return 0 if $pid < 0;
Can a pid be a negative number? I think not (but stand to be corrected).

Clarify, Correct: Can $pid be a negative number? I don't see anything in your code to support that (but still stand to be corrected).

Replies are listed 'Best First'.
Re^2: forking and timeouts
by almut (Canon) on Aug 09, 2007 at 13:14 UTC
    Can $pid be a negative number?

    In this case $pid is the return value of wait, which is (according to the docs) ...the pid of the deceased process, or "-1" if there are no child processes.

      ++, almut. Missed that.

      I do indeed stand corrected.