aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2011-01-13 16:15:15 +0100
committerDaniel Lezcano <dlezcano@fr.ibm.com>2011-01-13 16:15:15 +0100
commitd330fe7b86a602798a9286d43d66a1cf7e363754 (patch)
tree69434854e5d9853c9e487e90f825fc015adf521e
parentset function static (diff)
downloadlxc-d330fe7b86a602798a9286d43d66a1cf7e363754.tar.gz
lxc-d330fe7b86a602798a9286d43d66a1cf7e363754.tar.bz2
lxc-d330fe7b86a602798a9286d43d66a1cf7e363754.zip
mindless changes to conform indentation
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rw-r--r--src/lxc/conf.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 49361c4..b07375f 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -923,39 +923,43 @@ static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file)
mntflags = 0;
mntdata = NULL;
+
if (parse_mntopts(mntent, &mntflags, &mntdata) < 0) {
ERROR("failed to parse mount option '%s'",
- mntent->mnt_opts);
+ mntent->mnt_opts);
goto out;
}
/* now figure out where to mount it to. */
mntdir = mntent->mnt_dir;
mntroot = NULL;
+
if (!rootfs->path) {
- /* if we use system root fs,
- * the mount is relative to / and can be absolute */
+ /* if we use system root fs, the mount is relative to '/'
+ * and can be absolute */
if (mntdir[0] != '/')
- mntroot = ""; /* this is "/" */
- }
- else {
+ mntroot = ""; /* this is '/' */
+ } else {
/* else we have a separate root, mounts are
* relative to it, and absolute paths are risky */
if (mntdir[0] != '/')
- /* relative too root mount point */
+ /* relative to root mount point */
mntroot = rootfs->mount;
- else if (strncmp(mntdir, rootfs->mount, strlen(rootfs->mount)))
- WARN("mount target directory '%s' is outside container root",
- mntdir);
+ else if (strncmp(mntdir, rootfs->mount,
+ strlen(rootfs->mount)))
+ WARN("mount target directory '%s' is outside "
+ "container root", mntdir);
else
- WARN("mount target directory '%s' is not relative to container root",
- mntdir);
+ WARN("mount target directory '%s' is not "
+ "relative to container root", mntdir);
}
+
if (mntroot) {
/* make it relative to mntroot */
snprintf(path, sizeof(path), "%s/%s", mntroot, mntdir);
mntdir = path;
}
+
if (mount(mntent->mnt_fsname, mntdir,
mntent->mnt_type, mntflags & ~MS_REMOUNT, mntdata)) {
SYSERROR("failed to mount '%s' on '%s'",