]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: move cg_unified_flush() invocation out of parse_argv()
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Dec 2018 20:49:11 +0000 (21:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 Dec 2018 11:54:56 +0000 (12:54 +0100)
It has nothing to do with argument parsing, and hence shouldn't be
there.

src/nspawn/nspawn.c

index 03538d1c2f384846fb72d27f13cffc9e5385c4a5..d7bdae64a9bdc47c9da9064f55b064da677472c0 100644 (file)
@@ -1332,10 +1332,6 @@ static int parse_argv(int argc, char *argv[]) {
 
         arg_caps_retain = (arg_caps_retain | plus | (arg_private_network ? 1ULL << CAP_NET_ADMIN : 0)) & ~minus;
 
-        r = cg_unified_flush();
-        if (r < 0)
-                return log_error_errno(r, "Failed to determine whether the unified cgroups hierarchy is used: %m");
-
         e = getenv("SYSTEMD_NSPAWN_CONTAINER_SERVICE");
         if (e)
                 arg_container_service_name = e;
@@ -4226,6 +4222,12 @@ int main(int argc, char *argv[]) {
         if (r < 0)
                 goto finish;
 
+        r = cg_unified_flush();
+        if (r < 0) {
+                log_error_errno(r, "Failed to determine whether the unified cgroups hierarchy is used: %m");
+                goto finish;
+        }
+
         r = verify_arguments();
         if (r < 0)
                 goto finish;