Skip control tty code for non-ttys

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Stéphane Graber 2015-03-16 21:54:26 -04:00
parent 453d4bca05
commit d3b6301135

View 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);