]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: simplify arg_us_cgns passing
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Oct 2016 20:12:50 +0000 (16:12 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Oct 2016 20:46:58 +0000 (16:46 -0400)
We would check the condition cg_ns_supported() twice. No functional
change.

src/nspawn/nspawn-mount.c
src/nspawn/nspawn.c

index 25d38aa742a0e750bbf575cf3d81f8ff886430a7..0be06c8c0953edddd8324fc67916a4639aad5d69 100644 (file)
@@ -931,7 +931,7 @@ int mount_cgroups(
 
         if (unified_requested >= CGROUP_UNIFIED_ALL)
                 return mount_unified_cgroups(dest);
-        else if (use_cgns && cg_ns_supported())
+        else if (use_cgns)
                 return mount_legacy_cgns_supported(unified_requested, userns, uid_shift, uid_range, selinux_apifs_context);
 
         return mount_legacy_cgns_unsupported(dest, unified_requested, userns, uid_shift, uid_range, selinux_apifs_context);
index a173d171e157fc056b46fcc13e48045907393bac..d62b8c6b824f82ca5bbfb1834fffb720981e3576 100644 (file)
@@ -2724,7 +2724,7 @@ static int inner_child(
                                 arg_uid_shift,
                                 arg_uid_range,
                                 arg_selinux_apifs_context,
-                                arg_use_cgns);
+                                true);
                 if (r < 0)
                         return r;
         } else {
@@ -3136,7 +3136,7 @@ static int outer_child(
                                 arg_uid_shift,
                                 arg_uid_range,
                                 arg_selinux_apifs_context,
-                                arg_use_cgns);
+                                false);
                 if (r < 0)
                         return r;
         }