cgroups/cgfsng: rework cgfsng_monitor_enter()

parent 9322b1a3
......@@ -1445,9 +1445,18 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
char monitor[INTTYPE_TO_STRLEN(pid_t)],
transient[INTTYPE_TO_STRLEN(pid_t)];
if (!ops)
return ret_set_errno(false, ENOENT);
if (!ops->hierarchies)
return true;
if (!ops->monitor_cgroup)
return ret_set_errno(false, ENOENT);
if (!handler || !handler->conf)
return ret_set_errno(false, EINVAL);
monitor_len = snprintf(monitor, sizeof(monitor), "%d", handler->monitor_pid);
if (handler->transient_pid > 0)
transient_len = snprintf(transient, sizeof(transient), "%d",
......
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