cgroups/cgfsng: rework cgfsng_payload_enter()

parent 58222337
...@@ -1491,9 +1491,18 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops, ...@@ -1491,9 +1491,18 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops,
int len; int len;
char pidstr[INTTYPE_TO_STRLEN(pid_t)]; char pidstr[INTTYPE_TO_STRLEN(pid_t)];
if (!ops)
return ret_set_errno(false, ENOENT);
if (!ops->hierarchies) if (!ops->hierarchies)
return true; return true;
if (!ops->container_cgroup)
return ret_set_errno(false, ENOENT);
if (!handler || !handler->conf)
return ret_set_errno(false, EINVAL);
len = snprintf(pidstr, sizeof(pidstr), "%d", handler->pid); len = snprintf(pidstr, sizeof(pidstr), "%d", handler->pid);
for (int i = 0; ops->hierarchies[i]; i++) { for (int i = 0; ops->hierarchies[i]; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment