Skip to contentSkip to conversation

/cgroup/<pid> may already exist

PATCH New Sukadev Bhattiprolu 1 participant 1 message Dec 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /cgroup/<pid> may already exist

From: Sukadev Bhattiprolu <[email protected]>
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.

---
 ns_exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
ns_exec.c +1 -1
index 1f61771..df77dad 100644
@@ -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");
Signature · 1 line
1.6.0.4