[lxc-devel] [PATCH] Skip control tty code for non-ttys

Serge Hallyn serge.hallyn at ubuntu.com
Tue Mar 17 02:31:30 UTC 2015


Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  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 faa90fc..69dafd4 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);
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list