From: Mike Yuan Date: Tue, 20 Aug 2024 20:01:09 +0000 (+0200) Subject: process-util: check the flag instead of 'cgroup' param X-Git-Tag: v257-rc1~659^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df99a8ef3db84453fbe5acaa313ea7524b3ebb70;p=thirdparty%2Fsystemd.git process-util: check the flag instead of 'cgroup' param We might skip CLONE_INTO_CGROUP wholly if not supported. --- diff --git a/src/basic/process-util.c b/src/basic/process-util.c index a247b5a0b25..711457fa7b7 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -2118,7 +2118,7 @@ int posix_spawn_wrapper( } if (ERRNO_IS_NOT_SUPPORTED(r)) { /* clone3() could also return EOPNOTSUPP if the target cgroup is in threaded mode. */ - if (cgroup && cg_is_threaded(cgroup) > 0) + if (FLAGS_SET(flags, POSIX_SPAWN_SETCGROUP) && cg_is_threaded(cgroup) > 0) return -EUCLEAN; /* clone3() not available? */