[PATCH] Call _exit() instead of exit() if exec*() fails

From: sin <sin_AT_2f30.org>
Date: Tue, 11 Nov 2014 18:29:11 +0000

exit() will also unwind the atexit() functions. This is bad
because if exec*() fails the process is in an inconsistent state.
---
 st.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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
-- 
2.1.3
--W/nzBZO5zC0uMSeA--
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Tue Nov 11 2014 - 20:00:05 CET