From a16163f4a4a0f7ae29a1150fe517b11ca107fd90 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Thu, 7 Jan 2010 16:24:36 +0530 Subject: 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 --- src/api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/api.c') 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); -- cgit