container: use symlink to replace link

/dev/pts/ptmx is on the different filesystem with /dev/ptmx,
use symbol link.

Signed-off-by: Gao feng <feng@hyper.sh>
This commit is contained in:
Gao feng
2015-05-29 08:46:12 +08:00
committed by Gao feng
parent 377b5b89ce
commit 1f2865618b
+4 -2
View File
@@ -131,8 +131,10 @@ static int container_setup_mount(struct hyper_container *container)
return -1;
}
unlink("/dev/ptmx");
link("/dev/pts/ptmx", "/dev/ptmx");
if (unlink("/dev/ptmx") < 0)
perror("remove /dev/ptmx failed");
if (symlink("/dev/pts/ptmx", "/dev/ptmx") < 0)
perror("link /dev/pts/ptmx to /dev/ptmx failed");
for (i = 0; i < container->maps_num; i++) {
struct stat st;