--- rpl/src/rpl.c 2013/02/25 11:24:02 1.133 +++ rpl/src/rpl.c 2014/05/17 15:35:51 1.157 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.12 - Copyright (C) 1989-2012 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.18 + Copyright (C) 1989-2014 Dr. BERTRAND Joël This file is part of RPL/2. @@ -23,6 +23,10 @@ #define MAIN_RPL #include "rpl-conv.h" +// Bug de gcc à partir de gcc 4.6 (bug 48544) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclobbered" + /* ================================================================================ @@ -51,6 +55,8 @@ rplinit(int argc, char *argv[], char *en int erreur_historique; int option_P; + integer8 i; + logical1 core; logical1 debug; logical1 erreur_fichier; @@ -106,7 +112,6 @@ rplinit(int argc, char *argv[], char *en unsigned char *ptr; unsigned char *tampon; - unsigned long i; unsigned long unite_fichier; void *l_element_courant; @@ -219,7 +224,7 @@ rplinit(int argc, char *argv[], char *en return(EXIT_FAILURE); } - if ((arg_exec = malloc((argc + 1) * sizeof(char *))) == NULL) + if ((arg_exec = malloc((((size_t) argc) + 1) * sizeof(char *))) == NULL) { # ifndef SEMAPHORES_NOMMES sem_post(&semaphore_gestionnaires_signaux); @@ -241,7 +246,7 @@ rplinit(int argc, char *argv[], char *en return(EXIT_FAILURE); } - for(i = 0; i < (unsigned long) argc; i++) + for(i = 0; i < argc; i++) { arg_exec[i] = argv[i]; } @@ -259,7 +264,20 @@ rplinit(int argc, char *argv[], char *en pthread_mutexattr_init(&attributs_mutex); pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); - pthread_mutex_init(&((*s_etat_processus).mutex), &attributs_mutex); + pthread_mutex_init(&((*s_etat_processus).mutex_pile_processus), + &attributs_mutex); + pthread_mutexattr_destroy(&attributs_mutex); + + pthread_mutexattr_init(&attributs_mutex); + pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); + pthread_mutex_init(&((*s_etat_processus).mutex_interruptions), + &attributs_mutex); + pthread_mutexattr_destroy(&attributs_mutex); + + pthread_mutexattr_init(&attributs_mutex); + pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); + pthread_mutex_init(&((*s_etat_processus).mutex_signaux), + &attributs_mutex); pthread_mutexattr_destroy(&attributs_mutex); pthread_mutexattr_init(&attributs_mutex); @@ -284,16 +302,11 @@ rplinit(int argc, char *argv[], char *en if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(), pthread_self(), SEM_FORK)) == SEM_FAILED) { -# ifndef SEMAPHORES_NOMMES - sem_post(&semaphore_gestionnaires_signaux); - sem_destroy(&semaphore_gestionnaires_signaux); -# else - sem_post(semaphore_gestionnaires_signaux); - sem_destroy2(semaphore_gestionnaires_signaux, getpid(), - SEM_SIGNAUX); -# endif + sem_post(semaphore_gestionnaires_signaux); + sem_destroy2(semaphore_gestionnaires_signaux, getpid(), + SEM_SIGNAUX); - liberation(contexte_cas(s_etat_processus); + liberation_contexte_cas(s_etat_processus); if ((*s_etat_processus).langue == 'F') { @@ -332,7 +345,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -356,26 +369,26 @@ rplinit(int argc, char *argv[], char *en } else { -# ifndef SEMAPHORES_NOMMES - sem_post(&((*s_etat_processus).semaphore_fork)); - sem_post(&semaphore_gestionnaires_signaux); - sem_destroy(&semaphore_gestionnaires_signaux); - sem_destroy(&((*s_etat_processus).semaphore_fork)); -# else - sem_post((*s_etat_processus).semaphore_fork); - sem_post(semaphore_gestionnaires_signaux); - sem_destroy2(semaphore_gestionnaires_signaux, getpid(), - SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), - pthread_self(), SEM_FORK); -# endif - - liberation_contexte_cas(s_etat_processus); - liberation_queue_signaux(s_etat_processus); - if (((*s_etat_processus).localisation = malloc((strlen(d_locale) + 1) * sizeof(unsigned char))) == NULL) { +# ifndef SEMAPHORES_NOMMES + sem_post(&((*s_etat_processus).semaphore_fork)); + sem_post(&semaphore_gestionnaires_signaux); + sem_destroy(&semaphore_gestionnaires_signaux); + sem_destroy(&((*s_etat_processus).semaphore_fork)); +# else + sem_post((*s_etat_processus).semaphore_fork); + sem_post(semaphore_gestionnaires_signaux); + sem_destroy2(semaphore_gestionnaires_signaux, getpid(), + SEM_SIGNAUX); + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), + pthread_self(), SEM_FORK); +# endif + + liberation_contexte_cas(s_etat_processus); + liberation_queue_signaux(s_etat_processus); + if ((*s_etat_processus).langue == 'F') { uprintf("+++Système : Mémoire insuffisante\n"); @@ -408,7 +421,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -430,16 +443,20 @@ rplinit(int argc, char *argv[], char *en strcpy((*s_etat_processus).localisation, d_locale); } - printf("+++RPL/2 (R) version %s (%s)\n", d_version_rpl, - ((*s_etat_processus).langue == 'F') ? d_date_rpl : d_date_en_rpl); - - if ((*s_etat_processus).langue == 'F') - { - printf("+++Copyright (C) 1989 à 2012, 2013 BERTRAND Joël\n"); - } - else + if (resultats == NULL) // Appel direct { - printf("+++Copyright (C) 1989 to 2012, 2013 BERTRAND Joel\n"); + printf("+++RPL/2 (R) version %s (%s)\n", d_version_rpl, + ((*s_etat_processus).langue == 'F') + ? d_date_rpl : d_date_en_rpl); + + if ((*s_etat_processus).langue == 'F') + { + printf("+++Copyright (C) 1989 à 2013, 2014 BERTRAND Joël\n"); + } + else + { + printf("+++Copyright (C) 1989 to 2013, 2014 BERTRAND Joel\n"); + } } if (getenv("HOME") != NULL) @@ -478,7 +495,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -525,7 +542,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -566,7 +583,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -615,7 +632,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -653,7 +670,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -702,7 +719,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -740,7 +757,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -789,7 +806,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -830,7 +847,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -877,7 +894,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -918,7 +935,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -967,7 +984,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1008,7 +1025,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1057,7 +1074,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, getpid(), + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1163,7 +1180,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1207,7 +1224,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1258,7 +1275,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1321,7 +1338,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1374,7 +1391,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1417,7 +1434,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1462,7 +1479,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1507,7 +1524,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1551,7 +1568,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1596,7 +1613,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1633,7 +1650,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1670,7 +1687,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1716,7 +1733,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1770,7 +1787,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1815,7 +1832,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1852,7 +1869,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1897,7 +1914,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1942,7 +1959,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -1987,7 +2004,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2024,7 +2041,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2076,7 +2093,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2137,7 +2154,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2187,7 +2204,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2227,7 +2244,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2253,7 +2270,7 @@ rplinit(int argc, char *argv[], char *en } (*s_etat_processus).longueur_definitions_chainees = - strlen((*s_etat_processus) + (integer8) strlen((*s_etat_processus) .definitions_chainees); break; @@ -2274,7 +2291,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2326,7 +2343,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2387,7 +2404,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2436,7 +2453,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2511,7 +2528,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2558,7 +2575,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2602,7 +2619,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2731,7 +2748,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2774,7 +2791,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2823,7 +2840,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2867,7 +2884,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2923,7 +2940,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -2977,7 +2994,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3048,7 +3065,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3092,7 +3109,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3135,7 +3152,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3179,7 +3196,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3222,7 +3239,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3287,7 +3304,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3347,7 +3364,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3403,6 +3420,7 @@ rplinit(int argc, char *argv[], char *en (*s_etat_processus).liste_mutexes = NULL; (*s_etat_processus).sections_critiques = 0; + (*s_etat_processus).initialisation_scheduler = d_faux; (*s_etat_processus).test_instruction = 'N'; (*s_etat_processus).nombre_arguments = 0; @@ -3613,7 +3631,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3656,7 +3674,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3713,7 +3731,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3803,7 +3821,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3855,7 +3873,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3935,7 +3953,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -3991,7 +4009,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4088,7 +4106,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4147,7 +4165,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4234,7 +4252,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4282,7 +4300,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4331,7 +4349,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4379,7 +4397,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4432,7 +4450,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4482,7 +4500,7 @@ rplinit(int argc, char *argv[], char *en { (*s_etat_processus).erreur_systeme = d_es; encart(s_etat_processus, - (unsigned long) (5 * 1000000)); + (integer8) (5 * 1000000)); if ((*s_etat_processus).erreur_systeme != d_es) { @@ -4505,7 +4523,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4575,7 +4593,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4626,7 +4644,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4678,7 +4696,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4742,7 +4760,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4790,7 +4808,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4834,7 +4852,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4883,7 +4901,7 @@ rplinit(int argc, char *argv[], char *en sem_post(semaphore_gestionnaires_signaux); sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); - sem_destroy3((*s_etat_processus).semphore_fork, + sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4904,6 +4922,8 @@ rplinit(int argc, char *argv[], char *en return(EXIT_FAILURE); } + empilement_pile_systeme(s_etat_processus); + if (evaluation(s_etat_processus, s_objet, 'E') == d_erreur) { @@ -4933,7 +4953,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -4987,7 +5007,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -5036,7 +5056,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -5090,7 +5110,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -5138,15 +5158,95 @@ rplinit(int argc, char *argv[], char *en if (erreur == d_absence_erreur) { - if (((*s_etat_processus).var_volatile_alarme - == 0) && ((*s_etat_processus) + if (((*s_etat_processus) .arret_depuis_abort == 0) && ((*s_etat_processus).at_exit != NULL)) { + // Permet de traiter ATEXIT + // même après réception d'un SIGINT. + (*s_etat_processus) + .var_volatile_alarme = 0; + (*s_etat_processus) + .var_volatile_requete_arret = 0; + + if ((*s_etat_processus).profilage == + d_vrai) + { + profilage(s_etat_processus, + "ATEXIT"); + } + erreur = evaluation(s_etat_processus, (*s_etat_processus).at_exit, 'E'); + + if ((*s_etat_processus).profilage == + d_vrai) + { + profilage(s_etat_processus, NULL); + } + + if (((*s_etat_processus) + .erreur_execution != d_ex) || + ((*s_etat_processus).exception + != d_ep) || ((*s_etat_processus) + .erreur_systeme != d_es)) + { + printf("%s [%d]\n", message = + messages(s_etat_processus), + (int) getpid()); + free(message); + + if (test_cfsf(s_etat_processus, 51) + == d_faux) + { + printf("%s", ds_beep); + } + + if ((*s_etat_processus).core == + d_vrai) + { + printf("\n"); + + if ((*s_etat_processus).langue + == 'F') + { + printf("+++Information : Gé" + "nération du fichie" + "r rpl-core " + "[%d]\n", (int) + getpid()); + } + else + { + printf("+++Information : Wr" + "iting rpl-core fil" + "e [%d]\n", + (int) getpid()); + } + + rplcore(s_etat_processus); + + if ((*s_etat_processus).langue + == 'F') + { + printf("+++Information : Pr" + "ocessus tracé [%d]" + "\n", + (int) getpid()); + } + else + { + printf("+++Information : Do" + "ne [%d]\n", (int) + getpid()); + } + + printf("\n"); + fflush(stdout); + } + } } } } @@ -5159,15 +5259,95 @@ rplinit(int argc, char *argv[], char *en if (erreur == d_absence_erreur) { - if (((*s_etat_processus).var_volatile_alarme - == 0) && ((*s_etat_processus) + if (((*s_etat_processus) .arret_depuis_abort == 0) && ((*s_etat_processus).at_exit != NULL)) { + // Permet de traiter ATEXIT + // même après réception d'un SIGINT. + (*s_etat_processus) + .var_volatile_alarme = 0; + (*s_etat_processus) + .var_volatile_requete_arret = 0; + + if ((*s_etat_processus).profilage == + d_vrai) + { + profilage(s_etat_processus, + "ATEXIT"); + } + erreur = evaluation(s_etat_processus, (*s_etat_processus).at_exit, 'E'); + + if ((*s_etat_processus).profilage == + d_vrai) + { + profilage(s_etat_processus, NULL); + } + + if (((*s_etat_processus) + .erreur_execution != d_ex) || + ((*s_etat_processus).exception + != d_ep) || ((*s_etat_processus) + .erreur_systeme != d_es)) + { + printf("%s [%d]\n", message = + messages(s_etat_processus), + (int) getpid()); + free(message); + + if (test_cfsf(s_etat_processus, 51) + == d_faux) + { + printf("%s", ds_beep); + } + + if ((*s_etat_processus).core == + d_vrai) + { + printf("\n"); + + if ((*s_etat_processus).langue + == 'F') + { + printf("+++Information : Gé" + "nération du fichie" + "r rpl-core " + "[%d]\n", (int) + getpid()); + } + else + { + printf("+++Information : Wr" + "iting rpl-core fil" + "e [%d]\n", + (int) getpid()); + } + + rplcore(s_etat_processus); + + if ((*s_etat_processus).langue + == 'F') + { + printf("+++Information : Pr" + "ocessus tracé [%d]" + "\n", + (int) getpid()); + } + else + { + printf("+++Information : Do" + "ne [%d]\n", (int) + getpid()); + } + + printf("\n"); + fflush(stdout); + } + } } } } @@ -5208,7 +5388,8 @@ rplinit(int argc, char *argv[], char *en pthread_cancel((*s_etat_processus).thread_fusible); } - pthread_mutex_lock(&((*s_etat_processus).mutex)); + pthread_mutex_lock(&((*s_etat_processus) + .mutex_pile_processus)); l_element_courant = (void *) (*s_etat_processus) .l_base_pile_processus; @@ -5380,8 +5561,7 @@ rplinit(int argc, char *argv[], char *en l_element_courant = (void *) (*s_etat_processus).l_base_pile_processus; - for(i = 0; i < (unsigned long) - (*(*((struct_processus_fils *) + for(i = 0; i < (*(*((struct_processus_fils *) (*(*((struct_liste_chainee *) l_element_courant)).donnee).objet)).thread) .nombre_objets_dans_pipe; i++) @@ -5427,7 +5607,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -5445,8 +5625,8 @@ rplinit(int argc, char *argv[], char *en } # endif - pthread_mutex_unlock( - &((*s_etat_processus).mutex)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); return(EXIT_FAILURE); } @@ -5490,7 +5670,7 @@ rplinit(int argc, char *argv[], char *en semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX); sem_destroy3((*s_etat_processus) - .semphore_fork, getpid(), + .semaphore_fork, getpid(), pthread_self(), SEM_FORK); # endif @@ -5508,14 +5688,15 @@ rplinit(int argc, char *argv[], char *en } # endif - pthread_mutex_unlock( - &((*s_etat_processus).mutex)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); return(EXIT_FAILURE); } } } - pthread_mutex_unlock(&((*s_etat_processus).mutex)); + pthread_mutex_lock(&((*s_etat_processus) + .mutex_interruptions)); if ((*s_etat_processus) .nombre_interruptions_non_affectees != 0) @@ -5524,12 +5705,18 @@ rplinit(int argc, char *argv[], char *en s_etat_processus); } + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_interruptions)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); nanosleep(&attente, NULL); scrutation_interruptions(s_etat_processus); - pthread_mutex_lock(&((*s_etat_processus).mutex)); + pthread_mutex_lock(&((*s_etat_processus) + .mutex_pile_processus)); } - pthread_mutex_unlock(&((*s_etat_processus).mutex)); + pthread_mutex_unlock(&((*s_etat_processus) + .mutex_pile_processus)); erreur_historique = write_history( (*s_etat_processus).nom_fichier_historique); @@ -5721,8 +5908,9 @@ rplinit(int argc, char *argv[], char *en { free((*resultats)); - if (((*resultats) = malloc(((*s_etat_processus) - .hauteur_pile_operationnelle + 1) + if (((*resultats) = malloc(((size_t) + ((*s_etat_processus) + .hauteur_pile_operationnelle + 1)) * sizeof(unsigned char **))) != NULL) { (*resultats)[(*s_etat_processus) @@ -6041,8 +6229,10 @@ rplinit(int argc, char *argv[], char *en retrait_thread(s_etat_processus); - pthread_mutex_destroy(&((*s_etat_processus).mutex)); + pthread_mutex_destroy(&((*s_etat_processus).mutex_pile_processus)); pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation)); + pthread_mutex_destroy(&((*s_etat_processus).mutex_interruptions)); + pthread_mutex_destroy(&((*s_etat_processus).mutex_signaux)); pthread_mutex_destroy(&mutex_sections_critiques); pthread_mutex_destroy(&mutex_liste_variables_partagees); @@ -6072,8 +6262,11 @@ rplinit(int argc, char *argv[], char *en if ((*s_etat_processus).requete_redemarrage == d_vrai) { - chdir(repertoire_initial); - execvp(arg_exec[0], &(arg_exec[0])); + if (chdir(repertoire_initial) == 0) + { + execvp(arg_exec[0], &(arg_exec[0])); + } + erreur = d_erreur; } @@ -6220,4 +6413,6 @@ date_compilation() return(date); } +#pragma GCC diagnostic pop + // vim: ts=4