mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
service_unregister(): Also call inetd_del() for inetd services
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+4
-2
@@ -346,8 +346,10 @@ void inetd_stop(inetd_t *inetd)
|
|||||||
_d("Stopping %s socket watcher ...", inetd->svc->cmd);
|
_d("Stopping %s socket watcher ...", inetd->svc->cmd);
|
||||||
uev_io_stop(&inetd->watcher);
|
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)) {
|
if (!svc_is_busy(inetd->svc)) {
|
||||||
_d("Shutting down inet socket %d ...", inetd->watcher.fd);
|
_d("Shutting down inet socket %d ...", inetd->watcher.fd);
|
||||||
close(inetd->watcher.fd);
|
close(inetd->watcher.fd);
|
||||||
|
|||||||
+12
-4
@@ -850,6 +850,18 @@ recreate:
|
|||||||
|
|
||||||
void service_unregister(svc_t *svc)
|
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);
|
svc_del(svc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -970,10 +982,6 @@ restart:
|
|||||||
case SVC_DONE_STATE:
|
case SVC_DONE_STATE:
|
||||||
#ifdef INETD_ENABLED
|
#ifdef INETD_ENABLED
|
||||||
if (svc_is_inetd_conn(svc)) {
|
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);
|
service_unregister(svc);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user