Commit 4d8f52ac authored by Wolfram Sang's avatar Wolfram Sang Committed by Shuah Khan

selftests: timers: clocksource-switch: fix passing errors from child

The return value from system() is a waitpid-style integer. Do not return
it directly because with the implicit masking in exit() it will always
return 0. Access it with appropriate macros to really pass on errors.

Fixes: 7290ce14 ("selftests/timers: Add clocksource-switch test from timetest suite")
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarJohn Stultz <jstultz@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 04fd937e
...@@ -110,10 +110,10 @@ int run_tests(int secs) ...@@ -110,10 +110,10 @@ int run_tests(int secs)
sprintf(buf, "./inconsistency-check -t %i", secs); sprintf(buf, "./inconsistency-check -t %i", secs);
ret = system(buf); ret = system(buf);
if (ret) if (WIFEXITED(ret) && WEXITSTATUS(ret))
return ret; return WEXITSTATUS(ret);
ret = system("./nanosleep"); ret = system("./nanosleep");
return ret; return WIFEXITED(ret) ? WEXITSTATUS(ret) : 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment