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

2013-06-03 Thread U. Artie Eoff
From: U. Artie Eoff ullysses.a.e...@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().

v2: prefer _exit over _Exit

Signed-off-by: U. Artie Eoff ullysses.a.e...@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..37fce0a 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

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


RE: [PATCH weston v2] use _exit instead of exit if client fails to exec

2013-06-03 Thread Eoff, Ullysses A
Can we make sure this gets backported to 1.1, too?

 -Original Message-
 From: Eoff, Ullysses A
 Sent: Monday, June 03, 2013 4:23 PM
 To: wayland-devel@lists.freedesktop.org
 Cc: Eoff, Ullysses A
 Subject: [PATCH weston v2] use _exit instead of exit if client fails to exec
 
 From: U. Artie Eoff ullysses.a.e...@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().
 
 v2: prefer _exit over _Exit
 
 Signed-off-by: U. Artie Eoff ullysses.a.e...@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..37fce0a 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

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston v2] use _exit instead of exit if client fails to exec

2013-06-03 Thread Kristian Høgsberg
On Mon, Jun 03, 2013 at 04:22:31PM -0700, U. Artie Eoff wrote:
 From: U. Artie Eoff ullysses.a.e...@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().
 
 v2: prefer _exit over _Exit

Thanks, committed.  Will pick up for 1.1.

Kristian

 Signed-off-by: U. Artie Eoff ullysses.a.e...@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..37fce0a 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
 
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel