From: Stéphane Graber Date: Fri, 4 Jan 2013 18:56:13 +0000 (-0500) Subject: Don't call setup_mount_entries if the list is empty X-Git-Tag: lxc-0.9.0.alpha3~1^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1dc38c2e805cc82489d442185ad57d8334bde76;p=thirdparty%2Flxc.git 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: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index eb4f8bd23..e5e522c67 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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; }