]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Removed useless readlink before chrooting
authordlezcano <dlezcano>
Wed, 8 Oct 2008 14:15:58 +0000 (14:15 +0000)
committerdlezcano <dlezcano>
Wed, 8 Oct 2008 14:15:58 +0000 (14:15 +0000)
src/lxc/lxc_conf.c

index 08c6cd6208b7a3c349f4e2b99de32d88acf34e40..f8e1d0cd63fed964e5716861d0d94047b4ba0e17 100644 (file)
@@ -630,21 +630,18 @@ static int setup_utsname(const char *name)
 
 static int setup_rootfs(const char *name)
 {
-       char path[MAXPATHLEN], chrt[MAXPATHLEN];
+       char path[MAXPATHLEN];
 
        snprintf(path, MAXPATHLEN, LXCPATH "/%s/rootfs", name);
 
-       if (readlink(path, chrt, MAXPATHLEN) > 0) {
-
-               if (chroot(chrt)) {
-                       lxc_log_syserror("failed to set chroot %s", path);
-                       return -1;
-               }
+       if (chroot(path)) {
+               lxc_log_syserror("failed to set chroot %s", path);
+               return -1;
+       }
 
-               if (chdir(getenv("HOME")) && chdir("/")) {
-                       lxc_log_syserror("failed to change to home directory");
-                       return -1;
-               }
+       if (chdir(getenv("HOME")) && chdir("/")) {
+               lxc_log_syserror("failed to change to home directory");
+               return -1;
        }
 
        return 0;