aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2020-04-30 00:10:02 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-04-30 01:21:21 +0200
commitd6ea0a1a61853dd892029a7126e7fdb70c371878 (patch)
tree1f8c2881a9d6271fadd19f1ef36d1d0131f4e9de
parent43a395ae91f7d67ce694e65edeaa7bbc720dd027 (diff)
downloadst-d6ea0a1a61853dd892029a7126e7fdb70c371878.tar.gz
st-d6ea0a1a61853dd892029a7126e7fdb70c371878.tar.bz2
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.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index 0ce6ac2..2bf133f 100644
--- a/st.c
+++ b/st.c
@@ -730,7 +730,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