Prepare the nscgroup to be converted to the clone_children changes.

Signed-off-by: Daniel Lezcano <daniel.lezc...@free.fr>
---
 src/lxc/cgroup.c |    4 ++--
 src/lxc/cgroup.h |    2 +-
 src/lxc/start.c  |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index 96a8ecd..350d439 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -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
diff --git a/src/lxc/cgroup.h b/src/lxc/cgroup.h
index 640f1d2..905686e 100644
--- a/src/lxc/cgroup.h
+++ b/src/lxc/cgroup.h
@@ -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);
diff --git a/src/lxc/start.c b/src/lxc/start.c
index 451d355..7e17cc5 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -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)
-- 
1.7.0.4


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to