move symlink of devices to container_setup_mount()

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-04-06 10:35:50 +08:00
parent 90998a9b21
commit 8803fa8ccb
+5 -5
View File
@@ -197,6 +197,11 @@ static int container_setup_mount(struct hyper_container *container)
if (symlink("/dev/pts/ptmx", "./dev/ptmx") < 0)
perror("link /dev/pts/ptmx to /dev/ptmx failed");
symlink("/proc/self/fd", "./dev/fd");
symlink("/proc/self/fd/0", "./dev/stdin");
symlink("/proc/self/fd/1", "./dev/stdout");
symlink("/proc/self/fd/2", "./dev/stderr");
return 0;
}
@@ -541,11 +546,6 @@ static int hyper_container_init(void *data)
goto fail;
}
symlink("/proc/self/fd", "/dev/fd");
symlink("/proc/self/fd/0", "/dev/stdin");
symlink("/proc/self/fd/1", "/dev/stdout");
symlink("/proc/self/fd/2", "/dev/stderr");
execvp(container->exec.argv[0], container->exec.argv);
perror("exec container command failed");