diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2022-07-13 22:46:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 11:15:08 +0200 |
commit | 08e84df974286b3cc635b1a4e2f3cbd8f5759d53 (patch) | |
tree | 2ae3134bec449451f70a0c8f92db6733dbd91d3a /tools | |
parent | 3e4428ed322132e48e04980952f10a7dde0ac97d (diff) | |
download | linux-stable-08e84df974286b3cc635b1a4e2f3cbd8f5759d53.tar.gz linux-stable-08e84df974286b3cc635b1a4e2f3cbd8f5759d53.tar.bz2 linux-stable-08e84df974286b3cc635b1a4e2f3cbd8f5759d53.zip |
selftests: timers: clocksource-switch: fix passing errors from child
[ Upstream commit 4d8f52ac5fa9eede7b7aa2f2d67c841d9eeb655f ]
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: 7290ce1423c3 ("selftests/timers: Add clocksource-switch test from timetest suite")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/timers/clocksource-switch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c index bfc974b4572d..c18313a5f357 100644 --- a/tools/testing/selftests/timers/clocksource-switch.c +++ b/tools/testing/selftests/timers/clocksource-switch.c @@ -110,10 +110,10 @@ int run_tests(int secs) sprintf(buf, "./inconsistency-check -t %i", secs); ret = system(buf); - if (ret) - return ret; + if (WIFEXITED(ret) && WEXITSTATUS(ret)) + return WEXITSTATUS(ret); ret = system("./nanosleep"); - return ret; + return WIFEXITED(ret) ? WEXITSTATUS(ret) : 0; } |