From 2669880a2f59609269aadde8546385e10b0519d1 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Wed, 4 Mar 2009 16:59:49 +0530 Subject: libcgroup: Removed unused functions from api.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit api.c: At top level: api.c:1780: warning: ‘cg_prepare_controller_array’ defined but not used api.c:1805: warning: ‘cg_free_controller_array’ defined but not used Turns out no one is using this functions. Remove them. Signed-off-by: Dhaval Giani --- api.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/api.c b/api.c index 1883987..4745142 100644 --- a/api.c +++ b/api.c @@ -1769,51 +1769,6 @@ static int cg_prepare_cgroup(struct cgroup *cgroup, pid_t pid, return ret; } -/** - * This function takes a string which has got list of controllers separated - * by commas and it converts it to an array of string pointer where each - * string contains name of one controller. - * - * returns 0 on success. - */ -static int cg_prepare_controller_array(char *cstr, char *controllers[]) -{ - int j = 0; - char *temp = NULL; - char *saveptr = NULL; - - do { - if (j == 0) - temp = strtok_r(cstr, ",", &saveptr); - else - temp = strtok_r(NULL, ",", &saveptr); - - if (temp) { - controllers[j] = strdup(temp); - if (!controllers[j]) { - last_errno = errno; - return ECGOTHER; - } - } - j++; - } while (temp); - return 0; -} - - -static void cg_free_controller_array(char *controllers[]) -{ - int j = 0; - - /* Free up temporary controllers array */ - for (j = 0; j < CG_CONTROLLER_MAX; j++) { - if (!controllers[j]) - break; - free(controllers[j]); - controllers[j] = 0; - } -} - /** * Finds the first rule in the cached list that matches the given UID or GID, * and returns a pointer to that rule. This function uses rl_lock. -- cgit