in reply to Parent process dies unexpected
I don't know why, but commenting out the exit fixes it for FreeBSD (v5.8.0 built for i386-freebsd). Why would calling exit in the child exit the parent?
Update: The parent doesn't exit. $SIG{'CHLD'} is being called, but accept is returning false due to "Interrupted system call" ($! == 4). Maybe the CHLD signal interrupts accept?? no, that can't be it, cause it works fine without the call to exit. In any case, the following fix seems to work:
use POSIX; ... REDO_ACCEPT: { while ($client = $sock->accept()) { ... } redo if $! == EINTR; }
There might be a better way. I'm not familiar with this stuff. I just deduced this from debugging.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parent process dies unexpected
by gnork (Scribe) on Sep 29, 2004 at 07:23 UTC | |
by ikegami (Patriarch) on Sep 29, 2004 at 13:59 UTC | |
by gnork (Scribe) on Oct 01, 2004 at 11:12 UTC |