[Devel] [PATCH] /cgroup/<pid> may already exist

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Thu Dec 10 20:12:47 PST 2009


From: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
Date: Fri, 11 Dec 2009 09:36:05 +0530
Subject: [PATCH] /cgroup/pid may already exist

If the process is created with -g, the /cgroup/pid directory
would be created automatically.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 ns_exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ns_exec.c b/ns_exec.c
index 1f61771..df77dad 100644
--- a/ns_exec.c
+++ b/ns_exec.c
@@ -148,7 +148,7 @@ int move_to_new_cgroup(int newcgroup)
 
 	snprintf(cgroupname, 150, "%s/%d", cgroupbase, newcgroup);
 	ret = mkdir(cgroupname, 0755);
-	if (ret)
+	if (ret && errno != EEXIST)
 		return 0;
 	snprintf(tasksfname, 200, "%s/tasks", cgroupname);
 	fout = fopen(tasksfname, "w");
-- 
1.6.0.4

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list