| 5ca61106 | 24-Apr-2024 |
Nathan Chancellor <[email protected]> |
selftests/clone3: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are m
selftests/clone3: ksft_exit functions do not return
After commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn"), ksft_exit_...() functions are marked as __noreturn, which means the return type should not be 'int' but 'void' because they are not returning anything (and never were since exit() has always been called).
To facilitate updating the return type of these functions, remove 'return' before the calls to ksft_exit_{pass,fail}(), as __noreturn prevents the compiler from warning that a caller of the ksft_exit functions does not return a value because the program will terminate upon calling these functions.
Just removing 'return' would have resulted in
!ret ? ksft_exit_pass() : ksft_exit_fail();
so convert that into the more idiomatic
if (ret) ksft_exit_fail(); ksft_exit_pass();
Reviewed-by: Muhammad Usama Anjum <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 6a569511 | 09-Apr-2024 |
Mark Brown <[email protected]> |
selftests/clone3: Correct log message for waitpid() failures
When logging an error from calling waitpid() on the child we print a misleading error message saying that the error we report was returne
selftests/clone3: Correct log message for waitpid() failures
When logging an error from calling waitpid() on the child we print a misleading error message saying that the error we report was returned by the chilld. Fix this to say the error is from waitpid().
Applied after fixing merge conflict: Shuah Khan <[email protected]>
Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 698eb790 | 09-Apr-2024 |
Mark Brown <[email protected]> |
selftests/clone3: Check that the child exited cleanly
When the child exits during the clone3() selftest we use WEXITSTATUS() to get the exit status from the process without first checking WIFEXITED(
selftests/clone3: Check that the child exited cleanly
When the child exits during the clone3() selftest we use WEXITSTATUS() to get the exit status from the process without first checking WIFEXITED() to see if the result will be valid. This can lead to incorrect results, for example if the child exits due to signal. Add a WIFEXTED() check and report any non-standard exit as a failure, using EXIT_FAILURE as the exit status for call_clone3() since we otherwise report 0 or negative errnos.
Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| 7b8674ca | 09-Apr-2024 |
Mark Brown <[email protected]> |
selftests/clone3: Fix compiler warning
Shuah reported a compiler warning with an Ubuntu GCC 13 build, I've been unable to reproduce it but hopefully this fixes the issue:
clone3_set_tid.c:136:43: w
selftests/clone3: Fix compiler warning
Shuah reported a compiler warning with an Ubuntu GCC 13 build, I've been unable to reproduce it but hopefully this fixes the issue:
clone3_set_tid.c:136:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
Reported-by: Shuah Khan <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|