diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-08-06 12:03:18 +0530 |
---|---|---|
committer | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2009-08-06 12:03:18 +0530 |
commit | 0f9535116f2bb200e5d78095aafb22340c449740 (patch) | |
tree | 24973a7e408aa562c9b75bd85e4d6075e7a3b26f | |
parent | 4d88dd5f659a834704b4125de6949922d41ca7bb (diff) | |
download | libcg-0f9535116f2bb200e5d78095aafb22340c449740.tar.gz libcg-0f9535116f2bb200e5d78095aafb22340c449740.tar.xz libcg-0f9535116f2bb200e5d78095aafb22340c449740.zip |
libcgroup: Use the correct data type in the get_all_controller test case
get_all_controller.c: In function ‘main’:
get_all_controller.c:18: warning: passing argument 1 of ‘cgroup_get_all_controller_begin’ from incompatible pointer type
get_all_controller.c:23: warning: passing argument 1 of ‘cgroup_get_all_controller_next’ from incompatible pointer type
get_all_controller.c:31: warning: passing argument 1 of ‘cgroup_get_all_controller_end’ from incompatible pointer type
The test case used a FILE * instead of a void *. Correct this change (The datatype is opaque to the caller)
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
-rw-r--r-- | tests/get_all_controller.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/get_all_controller.c b/tests/get_all_controller.c new file mode 100644 index 0000000..3df3ca8 --- /dev/null +++ b/tests/get_all_controller.c @@ -0,0 +1,34 @@ +#include <libcgroup.h> +#include <stdio.h> +#include <stdlib.h> + +int main() +{ + int error; + void *handle; + struct controller_data info; + + error = cgroup_init(); + + if (error) { + printf("cgroup_init failed with %s\n", cgroup_strerror(error)); + exit(1); + } + + error = cgroup_get_all_controller_begin(&handle, &info); + + while (error != ECGEOF) { + printf("Controller %10s %5d %5d %5d\n", info.name, + info.hierarchy, info.num_cgroups, info.enabled); + error = cgroup_get_all_controller_next(&handle, &info); + if (error && error != ECGEOF) { + printf("cgroup_get_contrller_next failed with %s\n", + cgroup_strerror(error)); + exit(1); + } + } + + error = cgroup_get_all_controller_end(&handle); + + return 0; +} |