aaaa perche non funzia
This commit is contained in:
parent
209875cbdd
commit
c2d47cf457
11
TODO.txt
11
TODO.txt
|
@ -8,4 +8,13 @@
|
|||
che fa gia il controllo (ha come svantaggio che non puoi specifare dove va in errore con l'errexit)
|
||||
(anche se forse basta passare la/le stringe ma vedi riga 3) EDI APPROVA
|
||||
|
||||
- testare chiusura figli perche i miei terminali si chiudono da soli
|
||||
- testare chiusura figli perche i miei terminali si chiudono da soli
|
||||
|
||||
- fixare questo perche non funziona:
|
||||
sigint_count--;
|
||||
if (sigint_count > 0) {
|
||||
printfServer("Press again Ctrl^C to exit ");
|
||||
printf("(whitin %d sec)\n", TIME_TO_RESET);
|
||||
alarm(TIME_TO_RESET);
|
||||
} else {
|
||||
}
|
|
@ -124,6 +124,7 @@ int main(int argc, char *argv[]){
|
|||
printfServer("");
|
||||
printf("%s's turn\n", name[turn]);
|
||||
|
||||
// msgrcv(_MSGQID, &move, sizeof(move_t) - sizeof(long), MOVE, 0);
|
||||
rcvMove(&move);
|
||||
|
||||
//TMP
|
||||
|
|
|
@ -16,15 +16,26 @@ static int sigint_count = 2;
|
|||
void setSignal(int sig);
|
||||
|
||||
void sigHandlerServer(int sig) {
|
||||
// if (sig == SIGINT) { //FIXME: non riesco a farlo funzionare, quando premo ctr+c è come se gli arrivasse al server la mossa di un giocatore
|
||||
// sigint_count--;
|
||||
// if (sigint_count > 0) {
|
||||
// printfServer("Press again Ctrl^C to exit ");
|
||||
// printf("(whitin %d sec)\n", TIME_TO_RESET);
|
||||
// alarm(TIME_TO_RESET);
|
||||
// } else {
|
||||
// alarm(0); // toglie l'allarme
|
||||
// sig = SIGTERM;
|
||||
// }
|
||||
// }
|
||||
if (sig == SIGINT) {
|
||||
// sigint_count--;
|
||||
// if (sigint_count > 0) {
|
||||
// printfServer("Press again Ctrl^C to exit ");
|
||||
// printf("(whitin %d sec)\n", TIME_TO_RESET);
|
||||
// alarm(TIME_TO_RESET);
|
||||
// } else {
|
||||
// sig = SIGTERM;
|
||||
// }
|
||||
sigint_count--;
|
||||
if (!sigint_count) {
|
||||
kill(getpid(), SIGTERM);
|
||||
}
|
||||
|
||||
getchar();
|
||||
printf("est\n");
|
||||
sigint_count = 2;
|
||||
}
|
||||
|
||||
if (sig == SIGALRM) {
|
||||
|
|
Loading…
Reference in New Issue