]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Don't call setup_mount_entries if the list is empty
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 4 Jan 2013 18:56:13 +0000 (13:56 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 9 Jan 2013 15:22:54 +0000 (10:22 -0500)
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: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index eb4f8bd230fcbc96afb9b62484db7ef9a47eee76..e5e522c67d127126f73d8c982f00f70a475cf090 100644 (file)
@@ -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;
        }