summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-08-20 22:01:09 +0200
committerMike Yuan <me@yhndnzj.com>2024-08-21 15:17:05 +0200
commitdf99a8ef3db84453fbe5acaa313ea7524b3ebb70 (patch)
tree3f96b79cd394c85510cddb1b50e8e17a9794e3a1
parentman: use standard-options for --no-ask-password everywhere (diff)
downloadsystemd-df99a8ef3db84453fbe5acaa313ea7524b3ebb70.tar.xz
systemd-df99a8ef3db84453fbe5acaa313ea7524b3ebb70.zip
process-util: check the flag instead of 'cgroup' param
We might skip CLONE_INTO_CGROUP wholly if not supported.
-rw-r--r--src/basic/process-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index a247b5a0b2..711457fa7b 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? */