diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-10-26 15:25:21 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-10-26 18:43:34 +0200 |
commit | f99850a0d4fb6d00f43c050f33a1863f704358ad (patch) | |
tree | 88ca193b999f65bdcc0f1c292dd95861e72a881f | |
parent | 03afd780298897f948dab9345c0c4f1bc408bf8d (diff) | |
download | systemd-f99850a0d4fb6d00f43c050f33a1863f704358ad.tar.gz |
cgroup-util: FLAGS_SET()ify all things
-rw-r--r-- | src/basic/cgroup-util.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 1e159571c2..5c02f0cb35 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2144,9 +2144,9 @@ int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path n = cgroup_controller_to_string(c); - if (mask & bit) + if (FLAGS_SET(mask, bit)) (void) cg_create(n, path); - else if (supported & bit) + else if (FLAGS_SET(supported, bit)) (void) cg_trim(n, path, true); } @@ -2174,7 +2174,7 @@ int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_m if (!FLAGS_SET(CGROUP_MASK_V1, bit)) continue; - if (!(supported & bit)) + if (!FLAGS_SET(supported, bit)) continue; if (path_callback) @@ -2229,7 +2229,7 @@ int cg_migrate_everywhere(CGroupMask supported, const char *from, const char *to if (!FLAGS_SET(CGROUP_MASK_V1, bit)) continue; - if (!(supported & bit)) + if (!FLAGS_SET(supported, bit)) continue; if (to_callback) @@ -2264,7 +2264,7 @@ int cg_trim_everywhere(CGroupMask supported, const char *path, bool delete_root) if (!FLAGS_SET(CGROUP_MASK_V1, bit)) continue; - if (!(supported & bit)) + if (!FLAGS_SET(supported, bit)) continue; (void) cg_trim(cgroup_controller_to_string(c), path, delete_root); @@ -2290,7 +2290,7 @@ int cg_mask_to_string(CGroupMask mask, char **ret) { const char *k; size_t l; - if (!(mask & CGROUP_CONTROLLER_TO_MASK(c))) + if (!FLAGS_SET(mask, CGROUP_CONTROLLER_TO_MASK(c))) continue; k = cgroup_controller_to_string(c); @@ -2603,14 +2603,14 @@ int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) { if (!FLAGS_SET(CGROUP_MASK_V2, bit)) continue; - if (!(supported & bit)) + if (!FLAGS_SET(supported, bit)) continue; n = cgroup_controller_to_string(c); { char s[1 + strlen(n) + 1]; - s[0] = mask & bit ? '+' : '-'; + s[0] = FLAGS_SET(mask, bit) ? '+' : '-'; strcpy(s + 1, n); if (!f) { |