It's OK, if /dev/ptmx points to /dev/pts/ptmx via a symlink.

Signed-off-by: Sven Wegener <sven.wege...@stealer.net>
---
 src/lxc/conf.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 62b3727..483d375 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'");
-- 
1.7.4.5


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to