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>
 
        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;
 }