--- rpl/src/instructions_s1.c 2019/01/29 07:51:19 1.95 +++ rpl/src/instructions_s1.c 2019/02/07 21:44:15 1.99 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.30 + RPL/2 (R) version 4.1.31 Copyright (C) 1989-2019 Dr. BERTRAND Joël This file is part of RPL/2. @@ -3689,6 +3689,7 @@ instruction_syseval(struct_processus *s_ fflush(NULL); verrouillage_threads_concurrents(s_etat_processus); + pid = fork(); if (pid < 0) @@ -4028,10 +4029,21 @@ instruction_syseval(struct_processus *s_ } } +# ifndef SEMAPHORES_NOMMES + if (sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) +# else + if (sem_wait((*s_etat_processus).semaphore_fork) != 0) +# endif + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + do { if (kill(pid, 0) != 0) { + // Le processus n'existe plus. break; } @@ -4053,18 +4065,6 @@ instruction_syseval(struct_processus *s_ { if (errno != EINTR) { -# ifndef SEMAPHORES_NOMMES - if (sem_post(&((*s_etat_processus).semaphore_fork)) - != 0) -# else - if (sem_post((*s_etat_processus).semaphore_fork) - != 0) -# endif - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - (*s_etat_processus).erreur_systeme = d_es_processus; return; } @@ -4084,19 +4084,6 @@ instruction_syseval(struct_processus *s_ } } while((!WIFEXITED(status)) && (!WIFSIGNALED(status))); -# ifndef SEMAPHORES_NOMMES - while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) -# else - while(sem_wait((*s_etat_processus).semaphore_fork) != 0) -# endif - { - if (errno != EINTR) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - } - if (ios == -1) { (*s_etat_processus).erreur_systeme = d_es_processus; @@ -4220,6 +4207,8 @@ instruction_syseval(struct_processus *s_ liberation(s_etat_processus, s_objet_temporaire); } + free(arguments); + if ((tampon = malloc(sizeof(unsigned char))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -4289,7 +4278,6 @@ instruction_syseval(struct_processus *s_ return; } - free(arguments); free(tampon); } else