All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] /cgroup/<pid> may already exist
@ 2009-12-11  4:12 Sukadev Bhattiprolu
  0 siblings, 0 replies; only message in thread
From: Sukadev Bhattiprolu @ 2009-12-11  4:12 UTC (permalink / raw)
  To: serue-r/Jw6+rmf7HQT0dZR+AlfA; +Cc: Containers

From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-11  4:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11  4:12 [PATCH] /cgroup/<pid> may already exist Sukadev Bhattiprolu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.