From e0c8a7df66815a20b0525ac6db3470d890b6eb1b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 4 Mar 2015 14:45:21 +0100 Subject: [PATCH] inetd.c: Shutdown sockets properly before closing them. When changing runlevels netstat still listed closed sockets as being open and listening. With this patch all sockets are properly shut down before we close them. Signed-off-by: Joachim Nilsson --- inetd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/inetd.c b/inetd.c index 5b44e925..7ff25a2b 100644 --- a/inetd.c +++ b/inetd.c @@ -192,6 +192,7 @@ void inetd_stop(inetd_t *inetd) if (inetd->watcher.fd != -1) { uev_io_stop(&inetd->watcher); + shutdown(inetd->watcher.fd, SHUT_RDWR); close(inetd->watcher.fd); inetd->watcher.fd = -1; }