--- rpl/src/rpl.c 2011/06/21 15:26:35 1.69 +++ rpl/src/rpl.c 2011/09/09 12:23:25 1.81 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.0.prerelease.2 + RPL/2 (R) version 4.1.3 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -46,7 +46,6 @@ rplinit(int argc, char *argv[], unsigned int erreur_historique; int option_P; - int status; logical1 core; logical1 debug; @@ -183,9 +182,12 @@ rplinit(int argc, char *argv[], unsigned (*s_etat_processus).langue = 'E'; } + initialisation_contexte_cas(s_etat_processus); + (*s_etat_processus).exception = d_ep; (*s_etat_processus).erreur_systeme = d_es; (*s_etat_processus).erreur_execution = d_ex; + (*s_etat_processus).compteur_violation_d_acces = 0; (*s_etat_processus).rpl_home = rpl_home; @@ -438,6 +440,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGINT); + + if (signal_test != SIGINT) + { + 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); + } + if (sigaction(SIGTERM, &action, NULL) != 0) { erreur = d_es_signal; @@ -455,6 +477,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGTERM); + + if (signal_test != SIGTERM) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption2; # else @@ -477,6 +519,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGTSTP); + + if (signal_test != SIGTSTP) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption4; # else @@ -500,6 +562,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGSTART); + + if (signal_test != SIGSTART) + { + 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); + } + if (sigaction(SIGCONT, &action, NULL) != 0) { if ((*s_etat_processus).langue == 'F') @@ -515,6 +597,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGCONT); + + if (signal_test != SIGCONT) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption5; # else @@ -539,6 +641,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGFSTOP); + + if (signal_test != SIGFSTOP) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption11; # else @@ -563,6 +685,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGFABORT); + + if (signal_test != SIGFABORT) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption8; # else @@ -587,6 +729,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGURG); + + if (signal_test != SIGURG) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption7; # else @@ -611,6 +773,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGPIPE); + + if (signal_test != SIGPIPE) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption6; # else @@ -635,6 +817,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGINJECT); + + if (signal_test != SIGINJECT) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption9; # else @@ -659,6 +861,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGABORT); + + if (signal_test != SIGABORT) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption1; # else @@ -683,6 +905,26 @@ rplinit(int argc, char *argv[], unsigned return(EXIT_FAILURE); } + signal_test = SIGTEST; + kill(getpid(), SIGALRM); + + if (signal_test != SIGALRM) + { + 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); + } + # ifndef _BROKEN_SIGINFO action.sa_sigaction = interruption3; # else @@ -2764,6 +3006,20 @@ rplinit(int argc, char *argv[], unsigned if (setjmp(contexte_initial) == 0) { erreur = sequenceur(s_etat_processus); + + if (erreur == d_absence_erreur) + { + 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'); + } + } } } else @@ -2771,18 +3027,20 @@ rplinit(int argc, char *argv[], unsigned if (setjmp(contexte_initial) == 0) { erreur = sequenceur_optimise(s_etat_processus); - } - } - if (erreur == d_absence_erreur) - { - 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'); + if (erreur == d_absence_erreur) + { + 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'); + } + } } } } @@ -2991,8 +3249,6 @@ rplinit(int argc, char *argv[], unsigned while((*s_etat_processus).l_base_pile_processus != NULL) { - status = 0; - l_element_courant = (void *) (*s_etat_processus).l_base_pile_processus; @@ -3619,6 +3875,8 @@ rplinit(int argc, char *argv[], unsigned # undef return # endif + liberation_contexte_cas(s_etat_processus); + free((*s_etat_processus).chemin_fichiers_temporaires); free(s_etat_processus);