Commit c1dc38c2 by Stéphane Graber

Don't call setup_mount_entries if the list is empty

There's no good reason to call setup_mount_entries if we don't have any lxc.mount.entry. This also avoids an issue on bionic where the tmpfile() call in setup_mount_entries requires the presence of /tmp which isn't the case by default. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent fd5c4f90
......@@ -2602,7 +2602,7 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
return -1;
}
if (setup_mount_entries(&lxc_conf->rootfs, &lxc_conf->mount_list, name)) {
if (!lxc_list_empty(&lxc_conf->mount_list) && setup_mount_entries(&lxc_conf->rootfs, &lxc_conf->mount_list, name)) {
ERROR("failed to setup the mount entries for '%s'", name);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment