From fb97850d771423b5a19b4e990d9ab536e53507af Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Thu, 30 Apr 2020 00:10:02 +0200 Subject: [PATCH] replace exit(3) by _exit(2) in signal handler sigchld() exit(3) is not async-signal-safe but, _exit(2) is. This change prevents st to crash and dump core. --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 641edc0..b57bdea 100644 --- a/st.c +++ b/st.c @@ -737,7 +737,7 @@ sigchld(int a) die("child exited with status %d\n", WEXITSTATUS(stat)); else if (WIFSIGNALED(stat)) die("child terminated due to signal %d\n", WTERMSIG(stat)); - exit(0); + _exit(0); } void