--- rpl/src/interruptions.c 2011/11/18 09:51:33 1.85 +++ rpl/src/interruptions.c 2011/12/16 13:46:56 1.89 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 + RPL/2 (R) version 4.1.5 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -1760,8 +1760,6 @@ interruption3(int signal) // l'erreur d'accès à la mémoire. On sort donc du programme quitte à // ce qu'il reste des processus orphelins. - int ios; - unsigned char message_1[] = "+++System : Uncaught access violation\n" "+++System : Aborting !\n"; unsigned char message_2[] = "+++System : Stack overflow\n" @@ -1774,14 +1772,13 @@ interruption3(int signal) kill(pid_processus_pere, SIGUSR1); } - if (signal != SIGUSR2) { - ios = write(STDERR_FILENO, message_1, strlen(message_1)); + write(STDERR_FILENO, message_1, strlen(message_1)); } else { - ios = write(STDERR_FILENO, message_2, strlen(message_2)); + write(STDERR_FILENO, message_2, strlen(message_2)); } _exit(EXIT_FAILURE); @@ -1831,7 +1828,6 @@ interruption_violation_access(void *adre "violation\n"; static int compteur_erreur = 0; - int ios; if ((gravite == 0) && (routine_recursive != 0)) { @@ -1853,7 +1849,7 @@ interruption_violation_access(void *adre return(0); } - ios = write(STDERR_FILENO, message, strlen(message)); + write(STDERR_FILENO, message, strlen(message)); if (pid_processus_pere == getpid()) { @@ -1938,13 +1934,6 @@ signal_stop(struct_processus *s_etat_pro if (pid == getpid()) { - if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) - == NULL) - { - deverrouillage_gestionnaire_signaux(s_etat_processus); - return; - } - if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) { printf("[%d] RPL/SIGSTOP (thread %llu)\n", (int) getpid(), @@ -2013,8 +2002,6 @@ signal_inject(struct_processus *s_etat_p void interruption5(int signal) { - int ios; - unsigned char message[] = "+++System : SIGPIPE\n" "+++System : Aborting !\n"; @@ -2025,7 +2012,7 @@ interruption5(int signal) envoi_signal_processus(pid_processus_pere, rpl_sigalrm); } - ios = write(STDERR_FILENO, message, strlen(message)); + write(STDERR_FILENO, message, strlen(message)); return; } @@ -2038,13 +2025,6 @@ signal_urg(struct_processus *s_etat_proc if (pid == getpid()) { - if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) - == NULL) - { - deverrouillage_gestionnaire_signaux(s_etat_processus); - return; - } - if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) { printf("[%d] RPL/SIGURG (thread %llu)\n", (int) getpid(), @@ -2094,13 +2074,6 @@ signal_abort(struct_processus *s_etat_pr if (pid == getpid()) { - if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) - == NULL) - { - deverrouillage_gestionnaire_signaux(s_etat_processus); - return; - } - (*s_etat_processus).arret_depuis_abort = -1; /* @@ -2169,11 +2142,11 @@ signal_hup(struct_processus *s_etat_proc { fclose(fichier); - stdout = freopen(nom, "w", stdout); - stderr = freopen(nom, "w", stderr); + freopen(nom, "w", stdout); + freopen(nom, "w", stderr); } - stdin = freopen("/dev/null", "r", stdin); + freopen("/dev/null", "r", stdin); if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) { @@ -2626,6 +2599,8 @@ envoi_signal_processus(pid_t pid, enum s # endif } + kill(pid, SIGALRM); + return(0); } @@ -2689,6 +2664,8 @@ envoi_signal_thread(pthread_t tid, enum return(1); } + pthread_kill(tid, SIGALRM); + return(0); } @@ -2705,6 +2682,8 @@ envoi_signal_contexte(struct_processus * % LONGUEUR_QUEUE_SIGNAUX; pthread_mutex_unlock(&mutex_interruptions); + pthread_kill((*s_etat_processus_a_signaler).tid, SIGALRM); + return(0); }