Commit 62183f1a by Serge Hallyn Committed by Stéphane Graber

attach: don't ignore sigint/sigkill if stdin is redirected

If attach is being done over passed-in fds, then we shouldn't mess with the caller's signal table to ignore ctrl-c over the fd. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 9eaf8a59
...@@ -758,8 +758,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun ...@@ -758,8 +758,10 @@ int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_fun
} }
/* ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 */ /* ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313 */
signal(SIGINT, SIG_IGN); if (options->stdin_fd == 0) {
signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
}
/* reap intermediate process */ /* reap intermediate process */
ret = wait_for_pid(pid); ret = wait_for_pid(pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment