Commit b234e44f by Daniel Lezcano Committed by Daniel Lezcano

Change nscgroup interface

Prepare the nscgroup to be converted to the clone_children changes. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 7c282e3c
......@@ -85,7 +85,7 @@ out:
return err;
}
int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler)
int lxc_rename_nsgroup(const char *name, pid_t pid)
{
char oldname[MAXPATHLEN];
char newname[MAXPATHLEN];
......@@ -97,7 +97,7 @@ int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler)
return -1;
}
snprintf(oldname, MAXPATHLEN, "%s/%d", cgroup, handler->pid);
snprintf(oldname, MAXPATHLEN, "%s/%d", cgroup, pid);
snprintf(newname, MAXPATHLEN, "%s/%s", cgroup, name);
/* there is a previous cgroup, assume it is empty, otherwise
......
......@@ -26,7 +26,7 @@
#define MAXPRIOLEN 24
struct lxc_handler;
int lxc_rename_nsgroup(const char *name, struct lxc_handler *handler);
int lxc_rename_nsgroup(const char *name, pid_t pid);
int lxc_unlink_nsgroup(const char *name);
int lxc_cgroup_path_get(char **path, const char *name);
int lxc_cgroup_nrtasks(const char *name);
......
......@@ -506,7 +506,7 @@ int lxc_spawn(struct lxc_handler *handler)
if (lxc_sync_wait_child(handler, LXC_SYNC_CONFIGURE))
failed_before_rename = 1;
if (lxc_rename_nsgroup(name, handler))
if (lxc_rename_nsgroup(name, handler->pid))
goto out_delete_net;
if (failed_before_rename)
......
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