inetd.c: Only ever allow respawn if correct runlevel.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-03-04 11:48:16 +01:00
1 parent b644f6f635
commit 872d0d24e7
1 file changed
+2 -1
+2 -1
View File
@@ -169,7 +169,8 @@ int inetd_respawn(pid_t pid)
inetd_t *inetd = &svc->inetd;
svc->pid = 0;
if (!inetd->forking)
if (ISSET(svc->runlevels, runlevel) && !inetd->forking)
uev_io_set(&inetd->watcher, inetd->watcher.fd, UEV_READ);
return 1; /* It was us! */