aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorturret <turret@duck.com>2024-01-14 21:14:09 -0600
committerturret <turret@duck.com>2024-01-14 21:14:09 -0600
commit4179b6eb0e4434dcac1f6bbf2e78709df964bf77 (patch)
treec2f91fbf94d11b1ac3049cc2f28507d4ed6bd5bd /init
parentd4ba645474580e1da5a1297ceab40d5544bf53f0 (diff)
downloaddiscord-bot-skeleton-4179b6eb0e4434dcac1f6bbf2e78709df964bf77.tar.gz
discord-bot-skeleton-4179b6eb0e4434dcac1f6bbf2e78709df964bf77.tar.bz2
discord-bot-skeleton-4179b6eb0e4434dcac1f6bbf2e78709df964bf77.zip
log: minor optimisations
in panic, when killing process group, set pid to 0, where it gets our pgid for us, using kernel optimisations, saving a trip to kernel land to get the pgid ourselves
Diffstat (limited to 'init')
-rw-r--r--init/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/log.c b/init/log.c
index 83702c6..84ab7a1 100644
--- a/init/log.c
+++ b/init/log.c
@@ -175,7 +175,7 @@ void _panic(const char *fileorigin,
/* if we are going to die, we dont really need to clean up */
if(mode == PANICMODE_DIE) {
- kill(-getpgid(pid), SIGTERM);
+ kill(0, SIGTERM);
raise(SIGTERM);
exit(0);
}