service_unregister(): Also call inetd_del() for inetd services

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2018-01-19 16:07:22 +01:00
parent 4191abc79f
commit 2c904b5b44
2 changed files with 16 additions and 6 deletions
+4 -2
View File
@@ -346,8 +346,10 @@ void inetd_stop(inetd_t *inetd)
_d("Stopping %s socket watcher ...", inetd->svc->cmd);
uev_io_stop(&inetd->watcher);
/* For dgram inetd services we block the parent SVC
* and halt the watcher, so don't close the socket! */
/*
* For dgram inetd services we block the parent SVC
* and halt the watcher, so don't close the socket!
*/
if (!svc_is_busy(inetd->svc)) {
_d("Shutting down inet socket %d ...", inetd->watcher.fd);
close(inetd->watcher.fd);
+12 -4
View File
@@ -850,6 +850,18 @@ recreate:
void service_unregister(svc_t *svc)
{
if (!svc)
return;
if (svc_is_inetd(svc)) {
if (svc_is_busy(svc->inetd.svc)) {
svc_unblock(svc->inetd.svc);
service_step(svc->inetd.svc);
}
inetd_del(&svc->inetd);
}
svc_del(svc);
}
@@ -970,10 +982,6 @@ restart:
case SVC_DONE_STATE:
#ifdef INETD_ENABLED
if (svc_is_inetd_conn(svc)) {
if (svc_is_busy(svc->inetd.svc)) {
svc_unblock(svc->inetd.svc);
service_step(svc->inetd.svc);
}
service_unregister(svc);
return -1;
}