From c3941f32de6e82aa5161734e9693b7fdec015056 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 2 Sep 2020 09:28:32 +0200 Subject: [PATCH] attach: use lxc_terminal_signal_sigmask_safe_blocked() Signed-off-by: Christian Brauner --- src/lxc/attach.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 368dd41ad..9528d5406 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1384,14 +1384,10 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function, if (pid == 0) { if (options->attach_flags & LXC_ATTACH_TERMINAL) { - if (terminal.tty_state) - { - ret = pthread_sigmask(SIG_SETMASK, - &terminal.tty_state->oldmask, NULL); - if (ret < 0) { - SYSERROR("Failed to reset signal mask"); - _exit(EXIT_FAILURE); - } + ret = lxc_terminal_signal_sigmask_safe_blocked(&terminal); + if (ret < 0) { + SYSERROR("Failed to reset signal mask"); + _exit(EXIT_FAILURE); } } -- 2.47.2