--- rpl/src/semaphores.c 2012/12/19 09:58:28 1.52 +++ rpl/src/semaphores.c 2013/02/22 19:48:22 1.53 @@ -455,17 +455,23 @@ sem_wait_SysV(sem_t *semaphore) # ifndef OS2 // IPCS_SYSV struct sembuf commande; + // semop() ne renvoie pas EINTR sur un signal ! + commande.sem_num = 0; commande.sem_op = -1; commande.sem_flg = 0; - while(semop((*semaphore).sem, &commande, 1) == -1) + if (semop((*semaphore).sem, &commande, 1) == -1) { - if (errno != EINTR) + if (errno != EAGAIN) { errno = EINVAL; return(-1); } + else + { + return(-1); + } } return(0); @@ -513,13 +519,9 @@ sem_trywait_SysV(sem_t *semaphore) commande.sem_op = -1; commande.sem_flg = IPC_NOWAIT; - while(semop((*semaphore).sem, &commande, 1) == -1) + if (semop((*semaphore).sem, &commande, 1) == -1) { - if (errno != EINTR) - { - errno = EINVAL; - return(-1); - } + return(-1); } return(0);