]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
libcgrouptest: rename get_controller() to is_subsystem_enabled()
authorDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 14 Jan 2009 17:33:05 +0000 (17:33 +0000)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Wed, 14 Jan 2009 17:33:05 +0000 (17:33 +0000)
From: Sudhir Kumar <skumar@linux.vnet.ibm.com>

This patch renames the function get_controllers() to a more
meaningful name is_subsystem_enabled().

history:
The code in the patch is part of a patch sent in an earlier patchset,
which somehow got dropped (looks an older version of that patch was
merged to the tree). Adding this patch makes everything upstream upto
the discussion held on the list.

Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@314 4f4bb910-9a46-0410-90c8-c897d4f1cd53

tests/libcgrouptest.h
tests/libcgrouptest01.c
tests/test_functions.c

index 00765bde0f51c3c0321202900cfc530d34408f35..a0f82d637538fa071a4e0c5d581d82e6b3231071 100644 (file)
@@ -126,7 +126,7 @@ void test_cgroup_get_cgroup(int ctl1, int ctl2, struct uid_gid_t ids, int i);
 
 void test_cgroup_compare_cgroup(int ctl1, int ctl2, int i);
 void test_cgroup_add_free_controller(int i);
-void get_controllers(const char *name, int *exist);
+void is_subsystem_enabled(const char *name, int *exist);
 int group_exist(char *path_group);
 int set_controller(int controller, char *controller_name,
                                                 char *control_file);
index a4a492d6ad26d56b2f95df6fcb76363625b81e2d..d489d9cbae125d01e4b8796df6e69602c2e525b8 100644 (file)
@@ -73,8 +73,8 @@ int main(int argc, char *argv[])
        /*
         * check if one of the supported controllers is cpu or memory
         */
-       get_controllers("cpu", &cpu);
-       get_controllers("memory", &memory);
+       is_subsystem_enabled("cpu", &cpu);
+       is_subsystem_enabled("memory", &memory);
        if (cpu == 0 && memory == 0) {
                fprintf(stderr, "none of cpu and memory controllers"
                                                " is enabled in kernel\n");
index 6af9efdf934b0443adf5545f123fe4a64b3e7b97..80e4e9017039cc895544abb9cdcc4c9094b84b8d 100644 (file)
@@ -321,7 +321,7 @@ void test_cgroup_delete_cgroup(int retcode, struct cgroup *cgrp,
  * @param name the name of the controller to be checked
  * @param exist set to 1 if the controller exists
  */
-void get_controllers(const char *name, int *exist)
+void is_subsystem_enabled(const char *name, int *exist)
 {
        int hierarchy, num_cgroups, enabled;
        FILE *fd;