Commit 16683565 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

cgroup: Use local variable prop in restore_special_props()

For the purpose of separation this as a function, refactor
the code to use local variable prop, so the new function will have
(CgroupPropEntry *) type instead of (CgroupDirEntry *).
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b3e18c93
......@@ -1396,7 +1396,7 @@ static int restore_special_props(char *paux, size_t off, CgroupDirEntry *e)
continue;
}
if (!strcmp(e->properties[j]->name, "devices.list")) {
if (!strcmp(prop->name, "devices.list")) {
/* The devices cgroup must be restored in a
* special way: only the contents of
* devices.list can be read, and it is a
......@@ -1410,7 +1410,7 @@ static int restore_special_props(char *paux, size_t off, CgroupDirEntry *e)
* each line, because the kernel only parses
* the first line of any write().
*/
CgroupPropEntry *pe = e->properties[j];
CgroupPropEntry *pe = prop;
char *old_val = pe->value, *old_name = pe->name;
int ret;
char *pos;
......@@ -1426,7 +1426,7 @@ static int restore_special_props(char *paux, size_t off, CgroupDirEntry *e)
pe->name = "devices.deny";
pe->value = "a";
ret = restore_cgroup_prop(e->properties[j], paux, off);
ret = restore_cgroup_prop(prop, paux, off);
pe->name = old_name;
pe->value = old_val;
......
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