mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
cgroup: create 'name' or 'name:id' entries, not 'name:'
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+5
-1
@@ -102,7 +102,11 @@ static int move_pid(char *group, char *name, char *id, int pid)
|
||||
{
|
||||
char path[256];
|
||||
|
||||
snprintf(path, sizeof(path), "/sys/fs/cgroup/%s/%s:%s", group, name, id);
|
||||
snprintf(path, sizeof(path), "/sys/fs/cgroup/%s/%s", group, name);
|
||||
if (id && strlen(id)) {
|
||||
strlcat(path, ":", sizeof(path));
|
||||
strlcat(path, id, sizeof(path));
|
||||
}
|
||||
if (mkdir(path, 0755) && errno != EEXIST)
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user