From: Dhaval Giani Date: Thu, 7 Jan 2010 10:54:36 +0000 (+0530) Subject: libcgroup: Modify the APIs to use the namespace X-Git-Tag: v0.35~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a16163f4a4a0f7ae29a1150fe517b11ca107fd90;p=thirdparty%2Flibcgroup.git 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 --- diff --git a/src/api.c b/src/api.c index 5d31c37a..4a7185b6 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);