diff --git a/src/thread/sem_open.c b/src/thread/sem_open.c index 0ad29de9..7f648c19 100644 --- a/src/thread/sem_open.c +++ b/src/thread/sem_open.c @@ -34,7 +34,7 @@ sem_t *sem_open(const char *name, int flags, ...) va_list ap; mode_t mode; unsigned value; - int fd, i, e, slot, first=1, cnt, cs; + int fd, i, e, slot, first=1, cs, created=0; sem_t newsem; void *map; char tmp[64]; @@ -55,13 +55,8 @@ sem_t *sem_open(const char *name, int flags, ...) /* Reserve a slot in case this semaphore is not mapped yet; * this is necessary because there is no way to handle * failures after creation of the file. */ - slot = -1; - for (cnt=i=0; i