]> 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>
Tue, 17 Mar 2015 02:44:39 +0000 (22:44 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c

index faa90fcb932ac697b8ea7d8347642ded2e9f62ce..69dafd4bf3744d9dee0ff928233a1b83ef12460a 100644 (file)
@@ -985,7 +985,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);