cpuset_hotplug: fix cpuset_list_compute
PATCH 1/2 cpuset_hotplug: fix cpuset_list_compute
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.
--- .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c +1 -2
@@ -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) {
Signature · 1 line
2.17.1
PATCH 2/2 cpuset_list_compute fix exit value
Internal usage() helper was meant to use a custom exit value provided by the caller, so use it.
--- .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c +1 -1
@@ -24,7 +24,7 @@ int convert;static void usage (char *prog_name,int status) {fprintf (stderr,USAGE , prog_name); -exit (1 ); +exit (status); }static void checkopt (int argc,char **argv)
Signature · 1 line
2.17.1
PATCH 2/2 cpuset_list_compute fix exit value
Hi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/2 cpuset_hotplug: fix cpuset_list_compute
In reply to Cristian MarussiHi!
Quoted 11 lines
cpuset_hotplugfailed with:Usage :
cpuset_list_compute[-a|s] list1 [list2]-a|s list1 add/subtract list2.[default: -a]
-h Help.
cpuset_hotplug1 TFAIL: root group's cpus isn'texpected(Result: 0,2-5, Expect: ).It turned out that helper
cpuset_list_computewas always failing because it was improperly handling getopt retval.
It's working on intel, but I suppose that it overflows on arm since char is smaller than int there. It would be a bit better if something along these lines was written here. Otherwise the patch itself looks good.
Quoted 25 lines
Signed-off-by Cristian Marussi <[email protected]>--- .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c +1
-2@@ -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) {Signature · 5 lines
2.17.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/2 cpuset_hotplug: fix cpuset_list_compute
Hi
Quoted 10 lines · Cyril Hrubis
Hi!
Quoted 9 lines
cpuset_hotplugfailed with:Usage :
cpuset_list_compute[-a|s] list1 [list2]-a|s list1 add/subtract list2.[default: -a]
-h Help.
cpuset_hotplug1 TFAIL: root group's cpus isn'texpected(Result: 0,2-5, Expect: ).
Quoted 7 lines
Quoted 2 lines
It turned out that helper
cpuset_list_computewas always failing because it was improperly handling getopt retval.It's working on intel, but I suppose that it overflows on arm since char is smaller than int there. It would be a bit better if something along these lines was written here. Otherwise the patch itself looks good.
Fine I will add some more explanation.
Thanks
Cristian
Quoted 26 lines
Quoted 25 lines
Signed-off-by Cristian Marussi <[email protected]>--- .../cpuset/cpuset_hotplug_test/cpuset_list_compute.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c +1
-2@@ -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) {Signature · 5 lines
2.17.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp