Unverified Commit 5875fa24 by Stéphane Graber Committed by GitHub

Merge pull request #2029 from brauner/2017-12-12/do_not_unconditionally_dup_stdfds_for_execute

start: do not unconditionally dup std{in,out,err}
parents 547dfee3 5d113f65
...@@ -963,13 +963,18 @@ static int do_start(void *data) ...@@ -963,13 +963,18 @@ static int do_start(void *data)
* setup on its console ie. the pty allocated in lxc_console_create() so * setup on its console ie. the pty allocated in lxc_console_create() so
* make sure that that pty is stdin,stdout,stderr. * make sure that that pty is stdin,stdout,stderr.
*/ */
if (handler->conf->console.slave >= 0) if (handler->conf->console.slave >= 0) {
if (set_stdfds(handler->conf->console.slave) < 0) { if (handler->backgrounded || handler->conf->is_execute == 0)
ret = set_stdfds(handler->conf->console.slave);
else
ret = lxc_console_set_stdfds(handler->conf->console.slave);
if (ret < 0) {
ERROR("Failed to redirect std{in,out,err} to pty file " ERROR("Failed to redirect std{in,out,err} to pty file "
"descriptor %d", "descriptor %d",
handler->conf->console.slave); handler->conf->console.slave);
goto out_warn_father; goto out_warn_father;
} }
}
/* If we mounted a temporary proc, then unmount it now. */ /* If we mounted a temporary proc, then unmount it now. */
tmp_proc_unmount(handler->conf); tmp_proc_unmount(handler->conf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment