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.
This commit is contained in:
Jan Klemkow 2020-04-30 00:10:02 +02:00 committed by Lukasz M
parent 79b82c771e
commit fb97850d77

2
st.c
View File

@ -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