setup the exec env in hyper_do_exec_cmd()

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-06-05 22:50:59 +08:00
parent 40f04580ec
commit ab6ff1d2bd
+8 -3
View File
@@ -519,9 +519,8 @@ int hyper_enter_container(struct hyper_pod *pod,
/* TODO: wait for container finishing setup root */
chdir("/");
if (hyper_setup_env(c->exec.envs, c->exec.envs_num) < 0)
goto out;
ret = hyper_setup_env(exec->envs, exec->envs_num);
// TODO: let the hyperd do it (merging the env) when needed.
ret = hyper_setup_env(c->exec.envs, c->exec.envs_num);
out:
close(ipcns);
close(utsns);
@@ -596,6 +595,12 @@ static int hyper_do_exec_cmd(void *data)
goto exit;
}
// set the container env
if (hyper_setup_env(exec->envs, exec->envs_num) < 0) {
fprintf(stderr, "setup env failed\n");
goto exit;
}
if (hyper_dup_exec_tty(exec) < 0) {
fprintf(stderr, "dup pts to exec stdio failed\n");
goto exit;