--- rpl/src/rpl.c 2010/04/28 07:05:38 1.21 +++ rpl/src/rpl.c 2010/04/28 11:05:45 1.22 @@ -447,6 +447,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + action.sa_sigaction = interruption5; + action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; + + if (sigaction(SIGFABORT, &action, NULL) != 0) + { + erreur = d_es_signal; + + if ((*s_etat_processus).langue == 'F') + { + printf("+++Système : Initialisation des signaux POSIX " + "impossible\n"); + } + else + { + printf("+++System : Initialization of POSIX signals failed\n"); + } + + return(EXIT_FAILURE); + } + action.sa_sigaction = interruption8; action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; @@ -1857,6 +1877,7 @@ rplinit(int argc, char *argv[], unsigned (*s_etat_processus).var_volatile_traitement_sigint = 0; (*s_etat_processus).var_volatile_recursivite = 0; (*s_etat_processus).var_volatile_exception_gsl = 0; + (*s_etat_processus).arret_depuis_abort = 0; initialisation_allocateur(s_etat_processus); initialisation_drapeaux(s_etat_processus); @@ -2623,7 +2644,10 @@ rplinit(int argc, char *argv[], unsigned if (erreur == d_absence_erreur) { - if ((*s_etat_processus).at_exit != NULL) + if (((*s_etat_processus).var_volatile_alarme == 0) + && ((*s_etat_processus).arret_depuis_abort + == 0) && ((*s_etat_processus).at_exit + != NULL)) { erreur = evaluation(s_etat_processus, (*s_etat_processus).at_exit, 'E'); @@ -2750,10 +2774,21 @@ rplinit(int argc, char *argv[], unsigned } else { - kill((*(*((struct_processus_fils *) - (*(*((struct_liste_chainee *) - l_element_courant)).donnee).objet)) - .thread).pid, SIGFSTOP); + if ((*s_etat_processus).arret_depuis_abort + == -1) + { + kill((*(*((struct_processus_fils *) + (*(*((struct_liste_chainee *) + l_element_courant)).donnee).objet)) + .thread).pid, SIGFABORT); + } + else + { + kill((*(*((struct_processus_fils *) + (*(*((struct_liste_chainee *) + l_element_courant)).donnee).objet)) + .thread).pid, SIGFSTOP); + } } } else @@ -2778,10 +2813,25 @@ rplinit(int argc, char *argv[], unsigned } else { - pthread_kill((*(*((struct_processus_fils *) - (*(*((struct_liste_chainee *) - l_element_courant)).donnee).objet)) - .thread).tid, SIGFSTOP); + if ((*s_etat_processus).arret_depuis_abort + == -1) + { + pthread_kill( + (*(*((struct_processus_fils *) + (*(*((struct_liste_chainee *) + l_element_courant)).donnee) + .objet)).thread).tid, + SIGFABORT); + } + else + { + pthread_kill( + (*(*((struct_processus_fils *) + (*(*((struct_liste_chainee *) + l_element_courant)).donnee) + .objet)).thread).tid, + SIGFSTOP); + } } }