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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-03-04 14:45:21 +01:00
parent c769fbda0f
commit e0c8a7df66
+1
View File
@@ -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;
}