diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-24 17:52:58 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-02-24 17:52:58 +0100 |
commit | b4cccbc13ad6f98bd8e816ce5fffb99f5be74c8c (patch) | |
tree | 14313f0bd5cd2dad79fda852663d9038f81a35ad /src/nspawn/nspawn-mount.c | |
parent | fc9ae7178e1462377b272a14b1a763d480ab0980 (diff) |
cgroup: change cg_unified() to possibly return errors again
We use our cgroup APIs in various contexts, including from our libraries
sd-login, sd-bus. As we don#t control those environments we can't rely
that the unified cgroup setup logic succeeds, and hence really shouldn't
assert on it.
This more or less reverts 415fc41ceaeada2e32639f24f134b1c248b9e43f.
Diffstat (limited to 'src/nspawn/nspawn-mount.c')
-rw-r--r-- | src/nspawn/nspawn-mount.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index ed4f1f9db8..f6046d883a 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -991,7 +991,10 @@ static int mount_legacy_cgns_supported( return r; } - if (cg_all_unified()) + r = cg_all_unified(); + if (r < 0) + return r; + if (r > 0) goto skip_controllers; controllers = set_new(&string_hash_ops); @@ -1094,7 +1097,10 @@ static int mount_legacy_cgns_unsupported( return r; } - if (cg_all_unified()) + r = cg_all_unified(); + if (r < 0) + return r; + if (r > 0) goto skip_controllers; controllers = set_new(&string_hash_ops); |