Some testing for child reaping issues...

This commit is contained in:
Thulinma 2011-10-07 03:22:26 +02:00
parent 097188ba2f
commit 9849a0302a

View file

@ -36,9 +36,21 @@ Socket::Server server_socket(-1); ///< Placeholder for the server socket
/// and cleanly shut down the process. /// and cleanly shut down the process.
void signal_handler (int signum){ void signal_handler (int signum){
switch (signum){ switch (signum){
case SIGINT: break; case SIGINT:
case SIGHUP: break; #if DEBUG >= 1
case SIGTERM: break; fprintf(stderr, "Received SIGINT - closing server socket.\n");
#endif
break;
case SIGHUP:
#if DEBUG >= 1
fprintf(stderr, "Received SIGHUP - closing server socket.\n");
#endif
break;
case SIGTERM:
#if DEBUG >= 1
fprintf(stderr, "Received SIGTERM - closing server socket.\n");
#endif
break;
case SIGCHLD: case SIGCHLD:
wait(0); wait(0);
return; return;
@ -192,5 +204,8 @@ int main(int argc, char ** argv){
} }
} }
}//while connected }//while connected
#if DEBUG >= 1
fprintf(stderr, "Server socket closed, exiting.\n");
#endif
return 0; return 0;
}//main }//main