2
0
mirror of git://github.com/lxc/lxc synced 2025-09-02 13:39:34 +00:00

conf: mount_file_entries()

non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner
2017-08-01 22:00:44 +02:00
parent ebc524334a
commit 1ae3c19f47

View File

@@ -1989,35 +1989,27 @@ static int mount_entry_on_relative_rootfs(struct mntent *mntent,
} }
static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file, static int mount_file_entries(const struct lxc_rootfs *rootfs, FILE *file,
const char *lxc_name, const char *lxc_path) const char *lxc_name, const char *lxc_path)
{ {
struct mntent mntent; struct mntent mntent;
char buf[4096]; char buf[4096];
int ret = -1; int ret = -1;
while (getmntent_r(file, &mntent, buf, sizeof(buf))) { while (getmntent_r(file, &mntent, buf, sizeof(buf))) {
if (!rootfs->path)
if (!rootfs->path) { ret = mount_entry_on_systemfs(&mntent);
if (mount_entry_on_systemfs(&mntent)) else if (mntent.mnt_dir[0] != '/')
goto out; ret = mount_entry_on_relative_rootfs(&mntent, rootfs,
continue; lxc_name, lxc_path);
} else
ret = mount_entry_on_absolute_rootfs(&mntent, rootfs,
/* We have a separate root, mounts are relative to it */ lxc_name, lxc_path);
if (mntent.mnt_dir[0] != '/') { if (ret < 0)
if (mount_entry_on_relative_rootfs(&mntent, rootfs, lxc_name, lxc_path)) return -1;
goto out;
continue;
}
if (mount_entry_on_absolute_rootfs(&mntent, rootfs, lxc_name, lxc_path))
goto out;
} }
ret = 0; ret = 0;
INFO("mount points have been setup"); INFO("Set up mount entries");
out:
return ret; return ret;
} }