]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Skip control tty code for non-ttys
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 17 Mar 2015 01:54:26 +0000 (21:54 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 16:51:32 +0000 (12:51 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c

index 4a60cd299e3f629d78c7a8f11834fe5147b2a62f..24ba899eee9984d596e7f45c0c8826c2c6a0f433 100644 (file)
@@ -1075,7 +1075,7 @@ static int attach_child_main(void* data)
                new_gid = options->gid;
 
        /* setup the control tty */
-       if (options->stdin_fd) {
+       if (options->stdin_fd && isatty(options->stdin_fd)) {
                if (setsid() < 0) {
                        SYSERROR("unable to setsid");
                        shutdown(ipc_socket, SHUT_RDWR);