From: Lennart Poettering Date: Thu, 6 Dec 2018 20:49:11 +0000 (+0100) Subject: nspawn: move cg_unified_flush() invocation out of parse_argv() X-Git-Tag: v240~93^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5eee829043b21b8fdfddfa2119a314d612dc4a3d;p=thirdparty%2Fsystemd.git nspawn: move cg_unified_flush() invocation out of parse_argv() It has nothing to do with argument parsing, and hence shouldn't be there. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 03538d1c2f3..d7bdae64a9b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -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;