From 22cacb4dc96faae8814a9696805314c0fcc455ba Mon Sep 17 00:00:00 2001 From: turret Date: Mon, 18 Dec 2023 16:07:45 -0600 Subject: init: panic on no more subsystems --- init/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index 29c2128..c2ae3c4 100644 --- a/init/init.c +++ b/init/init.c @@ -10,6 +10,7 @@ #include extern int subsystem_handle_term(int pid); +extern int subsystem_count; int mainpid = 0; long stack_size = 8192 * 512; char *token; @@ -89,7 +90,7 @@ int main(void) sigaddset(&set, SIGCHLD); sigprocmask(SIG_BLOCK, &set, NULL); - while(1) { + while(subsystem_count > 0) { sigwaitinfo(&set, &siginfo); int sig = siginfo.si_signo; if(sig == SIGCHLD) { @@ -99,4 +100,6 @@ int main(void) print(LOG_WARNING "init: failed to reap process %d", process); } } + + panic("init: no more subsystems"); } -- cgit v1.2.3