--- rpl/src/interruptions.c 2010/12/08 20:59:38 1.43 +++ rpl/src/interruptions.c 2011/06/21 07:45:27 1.51 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.0.20 - Copyright (C) 1989-2010 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.0.prerelease.1 + Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -803,6 +803,7 @@ liberation_threads(struct_processus *s_e } } +#if 0 for(i = 0; i < (*s_etat_processus).nombre_variables; i++) { pthread_mutex_trylock(&((*(*s_etat_processus) @@ -822,6 +823,7 @@ liberation_threads(struct_processus *s_e } free((*s_etat_processus).s_liste_variables); +#endif for(i = 0; i < (*s_etat_processus).nombre_variables_statiques; i++) { @@ -1748,7 +1750,7 @@ interruption1(SIGHANDLER_ARGS) verrouillage_gestionnaire_signaux(); # ifdef _BROKEN_SIGINFO - if (signal == SIGINT) + if ((signal == SIGINT) || (signal == SIGTERM)) { // Si l'interruption provient du clavier, il n'y a pas eu d'appel // à queue_in(). @@ -1812,6 +1814,7 @@ interruption1(SIGHANDLER_ARGS) } case SIGINT : + case SIGTERM : { /* * Une vieille spécification POSIX permet au pointeur siginfo @@ -1837,8 +1840,17 @@ interruption1(SIGHANDLER_ARGS) if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) { - printf("[%d] SIGINT (thread %llu)\n", (int) getpid(), - (unsigned long long) pthread_self()); + if (signal == SIGINT) + { + printf("[%d] SIGINT (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + } + else + { + printf("[%d] SIGTERM (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + } + fflush(stdout); } @@ -1860,16 +1872,19 @@ interruption1(SIGHANDLER_ARGS) return; } - if (strncmp(getenv("LANG"), "fr", 2) == 0) - { - printf("+++Interruption\n"); - } - else + if (signal == SIGINT) { - printf("+++Interrupt\n"); - } + if (strncmp(getenv("LANG"), "fr", 2) == 0) + { + printf("+++Interruption\n"); + } + else + { + printf("+++Interrupt\n"); + } - fflush(stdout); + fflush(stdout); + } (*s_etat_processus).var_volatile_requete_arret = -1; (*s_etat_processus).var_volatile_alarme = -1;