]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgroup: Removed unused functions from api.c
authorDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 4 Mar 2009 11:29:49 +0000 (16:59 +0530)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 4 Mar 2009 11:29:49 +0000 (16:59 +0530)
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 <dhaval@linux.vnet.ibm.com>
api.c

diff --git a/api.c b/api.c
index 18839875d5edce4ae50ab7ffcaeec28f934ecdf8..474514238f0c3eada2a59deb820527457eb7f023 100644 (file)
--- 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.