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.
This commit is contained in:
sin 2014-11-11 18:29:11 +00:00 committed by Roberto E. Vargas Caballero
parent bafbba56cd
commit 4418939dd9

2
st.c
View File

@ -1190,7 +1190,7 @@ execsh(void) {
signal(SIGALRM, SIG_DFL);
execvp(prog, args);
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
}
void