sium fuanzia
This commit is contained in:
parent
d80203e938
commit
4b3c8f0c75
|
@ -20,7 +20,7 @@ pid_t _PIDS[2];
|
|||
void setServerSignal(int sig);
|
||||
|
||||
void sigIntHandler2(int sig) {
|
||||
kill(getpid(), SIGTERM);
|
||||
raise(SIGTERM);
|
||||
}
|
||||
|
||||
void sigHandlerServer(int sig) {
|
||||
|
@ -32,7 +32,7 @@ void sigHandlerServer(int sig) {
|
|||
|
||||
if (sig == SIGALRM) {
|
||||
printf(PSERVER "Time to exit (%d sec) expired\n", TIME_TO_RESET);
|
||||
signal(SIGINT, sigIntHandler2);
|
||||
signal(SIGINT, sigHandlerServer);
|
||||
}
|
||||
|
||||
// abbandono di un giocatore
|
||||
|
@ -50,10 +50,7 @@ void sigHandlerServer(int sig) {
|
|||
|
||||
printf("adesso vi chiudo\n");
|
||||
|
||||
_PIDS[0] = 0; // FIXME: cosi non li prova a richiudere dopo
|
||||
_PIDS[1] = 0;
|
||||
|
||||
sig = SIGTERM;
|
||||
raise(SIGTERM);
|
||||
}
|
||||
|
||||
if (sig == SIGTERM || sig == SIGHUP) {
|
||||
|
@ -161,8 +158,6 @@ void sigHandlerClient(int sig) {
|
|||
} else {
|
||||
printf("YOU LOST!!!\n");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue