diff --git a/src/fd.c b/src/fd.c index 828e140a0..5f432338c 100644 --- a/src/fd.c +++ b/src/fd.c @@ -128,8 +128,10 @@ void fd_add_to_fd_list(volatile struct fdlist *list, int fd, int off) redo_next: next = _GET_NEXT(fd, off); /* Check that we're not already in the cache, and if not, lock us. */ - if (next >= -2) + if (next > -2) goto done; + if (next == -2) + goto redo_next; if (!_HA_ATOMIC_CAS(&_GET_NEXT(fd, off), &next, -2)) goto redo_next; __ha_barrier_atomic_store();