From f6408accfeef91c743e62d99b2b53bfa1d8ff337 Mon Sep 17 00:00:00 2001 From: turret Date: Mon, 18 Dec 2023 16:04:53 -0600 Subject: subsys: decrement subsystem count on subsys termination --- init/subsys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init/subsys.c b/init/subsys.c index 65a71a4..d080ba6 100644 --- a/init/subsys.c +++ b/init/subsys.c @@ -28,7 +28,7 @@ struct subsystem_info { extern long stack_size; extern int mainpid; static struct subsystem_info *subsystems[MAX_SUBSYSTEMS + 1]; -static int subsystem_count = 0; +int subsystem_count = 0; static int __subsystem_entry(struct subsystem_info *info) { @@ -112,6 +112,7 @@ int subsystem_handle_term(int pid) "for subsystem %s (%d) (errno %d)", subsystem->fn_name, pid, errno); subsystems[i] = 0; + --subsystem_count; free(subsystem); return 0; -- cgit v1.2.3