From: Sven Wegener Date: Mon, 23 May 2011 21:12:24 +0000 (+0200) Subject: Check for existing ptmx symlink X-Git-Tag: lxc-0.7.5~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77890c6d6b198b68808a7ec3d0c4f0dbe87c0374;p=thirdparty%2Flxc.git Check for existing ptmx symlink It's OK, if /dev/ptmx points to /dev/pts/ptmx via a symlink. Signed-off-by: Sven Wegener Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 62b3727e9..483d37560 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -752,6 +752,8 @@ int setup_pivot_root(const struct lxc_rootfs *rootfs) static int setup_pts(int pts) { + char target[PATH_MAX]; + if (!pts) return 0; @@ -773,6 +775,9 @@ static int setup_pts(int pts) return -1; } + if (realpath("/dev/ptmx", target) && !strcmp(target, "/dev/pts/ptmx")) + goto out; + /* fallback here, /dev/pts/ptmx exists just mount bind */ if (mount("/dev/pts/ptmx", "/dev/ptmx", "none", MS_BIND, 0)) { SYSERROR("mount failed '/dev/pts/ptmx'->'/dev/ptmx'");