cgroup-util: assert on attribute for cg_{get,set}_attribute()
It makes zero sense to ever perform IO operations on cgroup dirs.
This commit is contained in:
@@ -1594,6 +1594,8 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
|
||||
_cleanup_free_ char *p = NULL;
|
||||
int r;
|
||||
|
||||
assert(attribute);
|
||||
|
||||
r = cg_get_path(controller, path, attribute, &p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -1605,6 +1607,8 @@ int cg_get_attribute(const char *controller, const char *path, const char *attri
|
||||
_cleanup_free_ char *p = NULL;
|
||||
int r;
|
||||
|
||||
assert(attribute);
|
||||
|
||||
r = cg_get_path(controller, path, attribute, &p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user