--- rpl/src/rpl.c 2010/04/28 06:41:06 1.20 +++ rpl/src/rpl.c 2010/04/29 07:30:58 1.23 @@ -447,6 +447,23 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + 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 +1874,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,8 +2641,14 @@ rplinit(int argc, char *argv[], unsigned if (erreur == d_absence_erreur) { - erreur = evaluation(s_etat_processus, - (*s_etat_processus).at_exit, 'E'); + 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'); + } } liberation(s_etat_processus, @@ -2747,10 +2771,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 @@ -2775,10 +2810,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); + } } } @@ -2811,13 +2861,6 @@ rplinit(int argc, char *argv[], unsigned l_element_courant = (void *) (*s_etat_processus).l_base_pile_processus; - if ((*s_etat_processus) - .nombre_interruptions_non_affectees != 0) - { - affectation_interruptions_logicielles( - s_etat_processus); - } - for(i = 0; i < (unsigned long) (*(*((struct_processus_fils *) (*(*((struct_liste_chainee *) @@ -2876,6 +2919,14 @@ rplinit(int argc, char *argv[], unsigned } pthread_mutex_unlock(&((*s_etat_processus).mutex)); + + if ((*s_etat_processus) + .nombre_interruptions_non_affectees != 0) + { + affectation_interruptions_logicielles( + s_etat_processus); + } + nanosleep(&attente, NULL); pthread_mutex_lock(&((*s_etat_processus).mutex)); }