From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [PATCH] /cgroup/ may already exist Date: Thu, 10 Dec 2009 20:12:47 -0800 Message-ID: <20091211041247.GD20947@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org Cc: Containers List-Id: containers.vger.kernel.org From: Sukadev Bhattiprolu 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 --- 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