From: Christian Brauner Date: Wed, 27 Jan 2021 15:10:24 +0000 (+0100) Subject: conf: fix coding style X-Git-Tag: lxc-5.0.0~315^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e25af1bc389f259991dad3c522af820352adeddb;p=thirdparty%2Flxc.git conf: fix coding style Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index f04312abc..499b1c96d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -639,8 +639,10 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, NULL, "%r/sys/devices/virtual/net", NULL, MS_REMOUNT|MS_BIND|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL, false }, { 0, 0, NULL, NULL, NULL, 0, NULL, false } }; + struct lxc_rootfs *rootfs = &conf->rootfs; + bool has_cap_net_admin; - bool has_cap_net_admin = lxc_wants_cap(CAP_NET_ADMIN, conf); + has_cap_net_admin = lxc_wants_cap(CAP_NET_ADMIN, conf); for (i = 0; default_mounts[i].match_mask; i++) { __do_free char *destination = NULL, *source = NULL; int saved_errno; @@ -650,7 +652,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha if (default_mounts[i].source) { /* will act like strdup if %r is not present */ - source = lxc_string_replace("%r", conf->rootfs.path ? conf->rootfs.mount : "", default_mounts[i].source); + source = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].source); if (!source) return -1; } @@ -664,7 +666,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha } /* will act like strdup if %r is not present */ - destination = lxc_string_replace("%r", conf->rootfs.path ? conf->rootfs.mount : "", default_mounts[i].destination); + destination = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].destination); if (!destination) return -1; @@ -672,7 +674,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha default_mounts[i].flags); r = safe_mount(source, destination, default_mounts[i].fstype, mflags, default_mounts[i].options, - conf->rootfs.path ? conf->rootfs.mount : NULL); + rootfs->path ? rootfs->mount : NULL); saved_errno = errno; if (r < 0 && errno == ENOENT) { INFO("Mount source or target for \"%s\" on \"%s\" does not exist. Skipping", source, destination); @@ -720,7 +722,7 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha if (!handler->cgroup_ops->mount(handler->cgroup_ops, handler, - conf->rootfs.path ? conf->rootfs.mount : "", + rootfs->path ? rootfs->mount : "", cg_flags)) return log_error_errno(-1, errno, "Failed to mount \"/sys/fs/cgroup\""); }