]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: use _exit() instead of exit() in the intermediate child process
authorJohannes Henninger <johannes@henninger.io>
Fri, 20 Feb 2015 13:11:03 +0000 (14:11 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 16:45:27 +0000 (12:45 -0400)
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 16d942c8398076e8cb14def47ddbb21b27613a20..4504a5b538674cb25caf3fa3e0469cc411465dad 100644 (file)
@@ -655,7 +655,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;