The rootfs is always located in rootfs->mount, let's use it for
the tty.

Signed-off-by: Daniel Lezcano <dlezc...@fr.ibm.com>
---
 src/lxc/conf.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 7755837..3da522f 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -386,12 +386,15 @@ static int setup_tty(const struct lxc_rootfs *rootfs,
        char path[MAXPATHLEN];
        int i;
 
+       if (!rootfs->path)
+               return 0;
+
        for (i = 0; i < tty_info->nbtty; i++) {
 
                struct lxc_pty_info *pty_info = &tty_info->pty_info[i];
 
                snprintf(path, sizeof(path), "%s/dev/tty%d",
-                        rootfs->path ? rootfs->path : "", i + 1);
+                        rootfs->mount ? rootfs->mount : LXCROOTFSMOUNT, i + 1);
 
                /* At this point I can not use the "access" function
                 * to check the file is present or not because it fails
-- 
1.7.0.4


------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to