--- rpl/src/interruptions.c 2010/12/08 20:59:38 1.43 +++ rpl/src/interruptions.c 2010/12/10 16:08:27 1.44 @@ -1748,7 +1748,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 +1812,7 @@ interruption1(SIGHANDLER_ARGS) } case SIGINT : + case SIGTERM : { /* * Une vieille spécification POSIX permet au pointeur siginfo @@ -1837,8 +1838,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 +1870,19 @@ interruption1(SIGHANDLER_ARGS) return; } - if (strncmp(getenv("LANG"), "fr", 2) == 0) + if (signal == SIGINT) { - printf("+++Interruption\n"); - } - else - { - 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;