Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cf6e837 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman
Browse files

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: 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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2f243fe8
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -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;
}
}