commit d6ea0a1a61853dd892029a7126e7fdb70c371878
Author:     Jan Klemkow <[email protected]>
AuthorDate: Thu Apr 30 00:10:02 2020 +0200
Commit:     Hiltjo Posthuma <[email protected]>
CommitDate: Thu Apr 30 01:21:21 2020 +0200

    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.

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

Reply via email to