summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2010-01-07 16:24:36 +0530
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2010-01-07 21:09:08 +0530
commita16163f4a4a0f7ae29a1150fe517b11ca107fd90 (patch)
treec75dcf1502695aa3df2137fd3352e82c4be8a829
parent99ccdf671e9df5b13f646e1487393d562aa7fa62 (diff)
downloadlibcg-a16163f4a4a0f7ae29a1150fe517b11ca107fd90.tar.gz
libcg-a16163f4a4a0f7ae29a1150fe517b11ca107fd90.tar.xz
libcg-a16163f4a4a0f7ae29a1150fe517b11ca107fd90.zip
libcgroup: Modify the APIs to use the namespace
Since every API builds its patch via build_path, updating that function should be enough. Changes from v1: 1. Append the namespace only if it is defined. This will remove an additional "/" which would be introduced otherwise. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-rw-r--r--src/api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api.c b/src/api.c
index 5d31c37..4a7185b 100644
--- a/src/api.c
+++ b/src/api.c
@@ -816,7 +816,13 @@ static char *cg_build_path_locked(char *name, char *path, char *type)
* XX: Change to snprintf once you figure what n should be
*/
if (strcmp(cg_mount_table[i].name, type) == 0) {
- sprintf(path, "%s/", cg_mount_table[i].path);
+ if (cg_namespace_table[i]) {
+ sprintf(path, "%s/%s/", cg_mount_table[i].path,
+ cg_namespace_table[i]);
+ } else {
+ sprintf(path, "%s/", cg_mount_table[i].path);
+ }
+
if (name) {
char *tmp;
tmp = strdup(path);