[LTP] [PATCH 1/2] [PATCH] cpuset_hotplug: fix cpuset_list_compute

Cristian Marussi cristian.marussi@arm.com
Wed Nov 14 15:21:46 CET 2018


cpuset_hotplug failed with:

Usage : cpuset_list_compute [-a|s] list1 [list2]

        -a|s   list1 add/subtract list2.[default: -a]

        -h     Help.
cpuset_hotplug 1 TFAIL: root group's cpus isn't expected(Result: 0,2-5, Expect: ).

It turned out that helper cpuset_list_compute was always failing because it was
improperly handling getopt retval.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c           | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
index 1b55f4b30..b9f176af4 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
@@ -29,8 +29,7 @@ static void usage(char *prog_name, int status)
 
 static void checkopt(int argc, char **argv)
 {
-	char c = '\0';
-	int optc = 0;
+	int c, optc = 0;
 
 	while ((c = getopt(argc, argv, "ahs")) != -1) {
 		switch (c) {
-- 
2.17.1



More information about the ltp mailing list