summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r--src/shared/cgroup-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index c1c4d409ae..f683ae990e 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -753,9 +753,9 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
cs = strlen(controller);
FOREACH_LINE(line, f, return -errno) {
- char *l, *p, *w, *e;
+ char *l, *p, *e;
size_t k;
- char *state;
+ const char *word, *state;
bool found = false;
truncate_nl(line);
@@ -771,16 +771,16 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
*e = 0;
- FOREACH_WORD_SEPARATOR(w, k, l, ",", state) {
+ FOREACH_WORD_SEPARATOR(word, k, l, ",", state) {
- if (k == cs && memcmp(w, controller, cs) == 0) {
+ if (k == cs && memcmp(word, controller, cs) == 0) {
found = true;
break;
}
if (k == 5 + cs &&
- memcmp(w, "name=", 5) == 0 &&
- memcmp(w+5, controller, cs) == 0) {
+ memcmp(word, "name=", 5) == 0 &&
+ memcmp(word+5, controller, cs) == 0) {
found = true;
break;
}