summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-09 18:35:52 +0100
committerLennart Poettering <lennart@poettering.net>2018-02-09 18:35:52 +0100
commitb734a4ff1433e3804a0cbf0801fb81a059f97a79 (patch)
treeac50ed1f57522ee7a0b9c14bb892fd3878c5b1c1 /src/basic/cgroup-util.h
parent744c39ff7e2646bcf90b9710b89e4769f8820025 (diff)
downloadsystemd-b734a4ff1433e3804a0cbf0801fb81a059f97a79.tar.gz
cgroup-util: rework cg_get_keyed_attribute() a bit
Let's make sure we don't clobber the return parameter on failure, to follow our coding style. Also, break the loop early if we have all attributes we need. This also changes the keys parameter to a simple char**, so that we can use STRV_MAKE() for passing the list of attributes to read. This also makes it possible to distuingish the case when the whole attribute file doesn't exist from one key in it missing. In the former case we return -ENOENT, in the latter we now return -ENXIO.
Diffstat (limited to 'src/basic/cgroup-util.h')
-rw-r--r--src/basic/cgroup-util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index 05c9f84505..068df102f7 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -186,7 +186,7 @@ int cg_create_and_attach(const char *controller, const char *path, pid_t pid);
int cg_set_attribute(const char *controller, const char *path, const char *attribute, const char *value);
int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret);
-int cg_get_keyed_attribute(const char *controller, const char *path, const char *attribute, const char **keys, char **values);
+int cg_get_keyed_attribute(const char *controller, const char *path, const char *attribute, char **keys, char **values);
int cg_set_access(const char *controller, const char *path, uid_t uid, gid_t gid);