In effort to clean up all the nasty defunct processes, I researched a little and came up with a way to catch SigChld's. This works GREAT... except for a crash bug...
Here's the scoop:
I have a signal( SIGCHLD, SigChld ); in game_loop.
static void SigChld( int signum )
int pid, status;
while( 1 )
pid = waitpid( WAIT_ANY, &status, WNOHANG );
if ( pid next )
if ( d->connected == CON_FORKED && d->process == pid )
if ( compilelock )
echo_to_all( AT_GREEN, "Compiler operation completed. Reboot and shutdown comm$
compilelock = FALSE;
d->process = 0;
d->connected = CON_PLAYING;
fcntl( d->descriptor, F_SETFL, FNDELAY );
ch = d->original ? d->original : d->character;
if ( ch )
ch_printf( ch, "Process exited with status code %d.\r\n", status );
After crashing the game many times, I find this:
Tue Nov 4, 2003 11:06:02 PM CST :: [*****] BUG: Nanny: bad d->connected 13
Nanny closes my link to Xorith.
All hell breaks loose as the rest of the game treats Xorith like a mobile.
anywho, any ideas?