From 1f2865618b8f9c045bc4d45f3f8ffdbed06f8672 Mon Sep 17 00:00:00 2001 From: Gao feng Date: Fri, 29 May 2015 08:46:12 +0800 Subject: [PATCH] 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 --- src/container.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/container.c b/src/container.c index 0e34924..80e75d1 100644 --- a/src/container.c +++ b/src/container.c @@ -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;