From df99a8ef3db84453fbe5acaa313ea7524b3ebb70 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Tue, 20 Aug 2024 22:01:09 +0200 Subject: [PATCH] process-util: check the flag instead of 'cgroup' param We might skip CLONE_INTO_CGROUP wholly if not supported. --- src/basic/process-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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? */ -- 2.47.3