--- rpl/src/interruptions.c 2016/03/21 12:08:05 1.172 +++ rpl/src/interruptions.c 2016/03/22 09:22:23 1.173 @@ -3144,12 +3144,33 @@ creation_queue_signaux(struct_processus return; } - if ((f_queue_signaux = shm_open(nom, O_RDWR | O_CREAT /* | O_EXCL*/, + if ((f_queue_signaux = shm_open(nom, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) == -1) { - sys_free(nom); - (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; - return; + if (errno != EEXIST) + { + sys_free(nom); + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } + + if ((*s_etat_processus).langue == 'F') + { + printf("+++Attention : Le segment de mémoire %s préexiste !\n", + nom); + } + else + { + printf("+++Warning: %s memory segment preexists!\n", nom); + } + + if ((f_queue_signaux = shm_open(nom, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR)) == -1) + { + sys_free(nom); + (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; + return; + } } if (ftruncate(f_queue_signaux, sizeof(struct_queue_signaux)) == -1)