From: Dhaval Giani Date: Wed, 4 Mar 2009 11:29:49 +0000 (+0530) Subject: libcgroup: Removed unused functions from api.c X-Git-Tag: v0.34~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2669880a2f59609269aadde8546385e10b0519d1;p=thirdparty%2Flibcgroup.git libcgroup: Removed unused functions from api.c 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 --- diff --git a/api.c b/api.c index 18839875..47451423 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.