diff --git a/src/haproxy.c b/src/haproxy.c index 22095175a..7458dee36 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2599,7 +2599,8 @@ void deinit(void) * Close it and give the listener its real state. */ if (p->state == PR_STSTOPPED && l->state >= LI_ZOMBIE) { - close(l->rx.fd); + fd_delete(l->rx.fd); + l->rx.fd = -1; l->state = LI_INIT; } unbind_listener(l); diff --git a/src/proxy.c b/src/proxy.c index 21d11ee24..18cdf426e 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1244,8 +1244,10 @@ void soft_stop(void) struct listener *, by_fe)->state > LI_ASSIGNED) { struct listener *l; list_for_each_entry(l, &p->conf.listeners, by_fe) { - if (l->state > LI_ASSIGNED) - close(l->rx.fd); + if (l->state > LI_ASSIGNED) { + fd_delete(l->rx.fd); + l->rx.fd = -1; + } l->state = LI_INIT; } }