]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: use _exit() instead of exit() in the intermediate child process 446/head
authorJohannes Henninger <johannes@henninger.io>
Fri, 20 Feb 2015 13:11:03 +0000 (14:11 +0100)
committerJohannes Henninger <johannes@henninger.io>
Fri, 20 Feb 2015 14:14:54 +0000 (15:14 +0100)
This prevents on_exit() and atexit() handlers registered by the parent
process from being run in the forked intermediate process.

Signed-off-by: Johannes Henninger <johannes@henninger.io>
src/lxc/attach.c

index 497e0d27da95c8f8085f0a405c3641e6dded5991..f70e42e8e7ef3697f4507f0c2923889a8373e9d2 100644 (file)
@@ -575,7 +575,7 @@ struct attach_clone_payload {
 static int attach_child_main(void* data);
 
 /* help the optimizer along if it doesn't know that exit always exits */
-#define rexit(c)  do { int __c = (c); exit(__c); return __c; } while(0)
+#define rexit(c)  do { int __c = (c); _exit(__c); return __c; } while(0)
 
 /* define default options if no options are supplied by the user */
 static lxc_attach_options_t attach_static_default_options = LXC_ATTACH_OPTIONS_DEFAULT;