From: Jan Safranek Date: Wed, 24 Aug 2011 09:39:19 +0000 (+0200) Subject: tests: Check cgroup_add_controller return value in test_functions X-Git-Tag: v0.38~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb6596e467c6db777734456341d476328945b63;p=thirdparty%2Flibcgroup.git tests: Check cgroup_add_controller return value in test_functions Discovered by gcc 4.6 as "warning: variable ‘controller’ set but not used" Signed-off-by: Jan Safranek Acked-by: Dhaval Giani --- diff --git a/tests/test_functions.c b/tests/test_functions.c index d9ca88ec..796a2af8 100644 --- a/tests/test_functions.c +++ b/tests/test_functions.c @@ -845,6 +845,12 @@ void test_cgroup_get_cgroup(int ctl1, int ctl2, struct uid_gid_t ids, int i) /* Create under another controller also */ ret = set_controller(ctl2, controller_name, control_file); controller = cgroup_add_controller(cgroup_a, controller_name); + if (controller) + message(i++, PASS, "cgroup_add_controller()", + 0, info[NOMESSAGE]); + else + message(i++, FAIL, "cgroup_add_controller()", + -1, info[NOMESSAGE]); } test_cgroup_create_cgroup(0, cgroup_a, "group_a", 0, 1, 1, 00);