]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: use lxc_terminal_signal_sigmask_safe_blocked() 3532/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 2 Sep 2020 07:28:32 +0000 (09:28 +0200)
committerScott Parlane <scott.parlane@alliedtelesis.co.nz>
Wed, 2 Sep 2020 20:40:52 +0000 (08:40 +1200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 368dd41ad1a7484fa667801fda84e1ab0dba38d0..9528d540643521e088c70b511b004e813b977ee2 100644 (file)
@@ -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);
                        }
                }