aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorturret <turret@duck.com>2023-12-18 16:04:53 -0600
committerturret <turret@duck.com>2023-12-18 16:04:53 -0600
commitf6408accfeef91c743e62d99b2b53bfa1d8ff337 (patch)
tree8e157bbd0ec13ca9df57cf30e814be1e0702d080 /init
parent1dbb4bb0feb53f1f927c405da3f64fb77d6edf3c (diff)
downloaddiscord-bot-skeleton-f6408accfeef91c743e62d99b2b53bfa1d8ff337.tar.gz
discord-bot-skeleton-f6408accfeef91c743e62d99b2b53bfa1d8ff337.tar.bz2
discord-bot-skeleton-f6408accfeef91c743e62d99b2b53bfa1d8ff337.zip
subsys: decrement subsystem count on subsys termination
Diffstat (limited to 'init')
-rw-r--r--init/subsys.c3
1 files changed, 2 insertions, 1 deletions
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;