From: Johannes Henninger Date: Fri, 20 Feb 2015 13:11:03 +0000 (+0100) Subject: attach: use _exit() instead of exit() in the intermediate child process X-Git-Tag: lxc-1.1.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9b834741b3e1937a53f780fbfeeee9e25ff2776;p=thirdparty%2Flxc.git attach: use _exit() instead of exit() in the intermediate child process 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 --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 497e0d27d..f70e42e8e 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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;