cgroup-show: drop unnecessary call of cg_mangle_path()
As the caller already dropped controller part.
This commit is contained in:
@@ -687,25 +687,6 @@ int cg_split_spec(const char *spec, char **ret_controller, char **ret_path) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cg_mangle_path(const char *path, char **ret) {
|
||||
_cleanup_free_ char *p = NULL;
|
||||
int r;
|
||||
|
||||
assert(path);
|
||||
assert(ret);
|
||||
|
||||
/* First, check if it already is a filesystem path */
|
||||
if (path_startswith(path, "/sys/fs/cgroup"))
|
||||
return path_simplify_alloc(path, ret);
|
||||
|
||||
/* Otherwise, treat it as cg spec */
|
||||
r = cg_split_spec(path, /* ret_controller = */ NULL, &p);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return cg_get_path(p, /* suffix = */ NULL, ret);
|
||||
}
|
||||
|
||||
int cg_get_root_path(char **ret_path) {
|
||||
char *p, *e;
|
||||
int r;
|
||||
|
||||
@@ -162,7 +162,6 @@ int cg_kill_kernel_sigkill(const char *path);
|
||||
int cg_kill_recursive(const char *path, int sig, CGroupFlags flags, Set *killed_pids, cg_kill_log_func_t log_kill, void *userdata);
|
||||
|
||||
int cg_split_spec(const char *spec, char **ret_controller, char **ret_path);
|
||||
int cg_mangle_path(const char *path, char **ret);
|
||||
|
||||
int cg_get_path(const char *path, const char *suffix, char **ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user