From: Michel Normand Date: Wed, 26 May 2010 14:54:48 +0000 (+0200) Subject: sigprocmask moved in fini of start.c X-Git-Tag: lxc-0.7.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f64a3f64f7148deb0deb5fcd1d81a3a31a2a1e8;p=thirdparty%2Flxc.git sigprocmask moved in fini of start.c Signed-off-by: Michel Normand Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 5924c1436..c6eef46a6 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -398,6 +398,10 @@ void lxc_fini(const char *name, struct lxc_handler *handler) lxc_set_state(name, handler, STOPPING); lxc_set_state(name, handler, STOPPED); + /* reset mask set by setup_sigchld_fd */ + if (sigprocmask(SIG_SETMASK, &handler->oldmask, NULL)) + WARN("failed to restore sigprocmask"); + lxc_delete_console(&handler->conf->console); lxc_delete_tty(&handler->conf->tty_info); free(handler->name); @@ -609,9 +613,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf) while (waitpid(handler->pid, &status, 0) < 0 && errno == EINTR) continue; - if (sigprocmask(SIG_SETMASK, &handler->oldmask, NULL)) - WARN("failed to restore sigprocmask"); - err = lxc_error_set_and_log(handler->pid, status); out_fini: lxc_unlink_nsgroup(name);