[hackers] [st] Call _exit() instead of exit() if exec*() fails || sin

From: <git_AT_suckless.org>
Date: Wed, 19 Nov 2014 18:55:02 +0100

commit 4418939dd9f3a7b3cfd3071234ed18ae86538f2a
Author: sin <sin_AT_2f30.org>
Date: Tue Nov 11 18:29:11 2014 +0000

    Call _exit() instead of exit() if exec*() fails
    
    exit() will also unwind the atexit() functions. This is bad
    because if exec*() fails the process is in an inconsistent state.

diff --git a/st.c b/st.c
index 068fbb3..4499be6 100644
--- a/st.c
+++ b/st.c
_AT_@ -1190,7 +1190,7 @@ execsh(void) {
         signal(SIGALRM, SIG_DFL);
 
         execvp(prog, args);
- exit(EXIT_FAILURE);
+ _exit(EXIT_FAILURE);
 }
 
 void
Received on Wed Nov 19 2014 - 18:55:02 CET

This archive was generated by hypermail 2.3.0 : Wed Nov 19 2014 - 19:00:12 CET