From bb357be604b64d489b6015f4c7466be51a748929 Mon Sep 17 00:00:00 2001 From: turret Date: Sun, 14 Jan 2024 19:50:24 -0600 Subject: init: modify panic termination sequence in log: we ensure we panic by killing our process group with SIGTERM, raising it for ourselves, and exiting (if all else fails simply). in init: we catch SIGTERM and exit with 0 if we get it, as bash (and likely others) prints a nasty "Terminated" to stderr --- init/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'init/log.c') diff --git a/init/log.c b/init/log.c index 9564053..83702c6 100644 --- a/init/log.c +++ b/init/log.c @@ -175,7 +175,9 @@ 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), SIGKILL); + kill(-getpgid(pid), SIGTERM); + raise(SIGTERM); + exit(0); } print(NOLOCK("5") "------------[ cut here ]------------"); -- cgit v1.2.3