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.0.8~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c02db614d01dd1a8093eab226a0d5fcf494624a7;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 16d942c83..4504a5b53 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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;