Commit 4418939

sin <sin@2f30.org>
2014-11-11 13:29:11
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.
1 parent bafbba5
Changed files (1)
st.c
@@ -1190,7 +1190,7 @@ execsh(void) {
 	signal(SIGALRM, SIG_DFL);
 
 	execvp(prog, args);
-	exit(EXIT_FAILURE);
+	_exit(EXIT_FAILURE);
 }
 
 void