From 53274cff02994b78eb7dcf17f1dda8da9d6bc5e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Mon, 16 Mar 2015 21:54:26 -0400 Subject: [PATCH] Skip control tty code for non-ttys MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/lxc/attach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index 4a60cd299..24ba899ee 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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); -- 2.47.2