summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-11-11 18:29:11 +0000
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-11-19 18:52:42 +0100
commit4418939dd9f3a7b3cfd3071234ed18ae86538f2a (patch)
tree69d883225303d156e0afcacd96b12612d55d57c8
parentCheck for presence of SHELL environment variable (diff)
downloadst-4418939dd9f3a7b3cfd3071234ed18ae86538f2a.tar.gz
st-4418939dd9f3a7b3cfd3071234ed18ae86538f2a.zip
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.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index 068fbb3..4499be6 100644
--- a/st.c
+++ b/st.c
@@ -1190,7 +1190,7 @@ execsh(void) {
1190 signal(SIGALRM, SIG_DFL); 1190 signal(SIGALRM, SIG_DFL);
1191 1191
1192 execvp(prog, args); 1192 execvp(prog, args);
1193 exit(EXIT_FAILURE); 1193 _exit(EXIT_FAILURE);
1194} 1194}
1195 1195
1196void 1196void