From: Stéphane Graber Date: Tue, 17 Mar 2015 01:54:26 +0000 (-0400) Subject: Skip control tty code for non-ttys X-Git-Tag: lxc-2.0.0.beta1~341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3b6301135280d21d0c1c7d427e1c587b3177b69;p=thirdparty%2Flxc.git Skip control tty code for non-ttys Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/attach.c b/src/lxc/attach.c index faa90fcb9..69dafd4bf 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -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);