[PATCH weston] use _Exit instead of exit if client fails to exec

U. Artie Eoff ullysses.a.eoff at intel.com
Mon Jun 3 16:09:59 PDT 2013


From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>

exit() calls atexit() handlers and C++ destructors (e.g. a C++
weston module) which could destroy state that the main process
depends on (e.g. ioctl's, tmpfiles, sockets, etc...).  If an exec
fails, call _Exit() instead of exit().

Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
 src/compositor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index f382340..45a87d4 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -221,7 +221,7 @@ weston_client_launch(struct weston_compositor *compositor,
 
 	if (pid == 0) {
 		child_client_exec(sv[1], path);
-		exit(-1);
+		_Exit(-1);
 	}
 
 	close(sv[1]);
-- 
1.7.11.7



More information about the wayland-devel mailing list