linux-yocto/tools/testing/selftests/timers
Shuah Khan ba87297200 selftests:timers: posix_timers: Fix warn_unused_result in __fatal_error()
__fatal_error routine doesn't check strerror_r() return value,
which results in the following compile time warning:

posix_timers.c: In function ‘__fatal_error’:
posix_timers.c:31:9: warning: ignoring return value of ‘strerror_r’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   31 |         strerror_r(errno, buf, sizeof(buf));

Fix this by adding a check for return value and error handling appropriate
for the GNU-specific strerror_r() in use in __fatal_error(). Check if
return string is null and handle accordingly.

From Linux strerror_r() manual page:

"The GNU-specific strerror_r() returns a pointer to a string containing
the error message. This may be either a pointer to a string that the
function stores in buf, or a pointer to some (immutable) static string
(in which case buf is unused). If the function stores a string in buf,
then at most buflen bytes are stored (the string may be truncated if
buflen is too small and errnum is unknown). The string always includes
a terminating null byte."

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: John Stultz <jstultz@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2024-09-30 11:37:55 -06:00
..
.gitignore
adjtick.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
alarmtimer-suspend.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
change_skew.c selftests/timers: Remove unused NSEC_PER_SEC macro 2024-09-06 13:37:41 -06:00
clocksource-switch.c selftests: timers: clocksource-switch: adapt to kselftest framework 2022-07-14 14:36:52 -06:00
freq-step.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
inconsistency-check.c selftests: timers: inconsistency-check: adapt to kselftest framework 2022-07-14 14:36:18 -06:00
leap-a-day.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
leapcrash.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
Makefile selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
mqueue-lat.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
nanosleep.c selftests: timers: nanosleep: adapt to kselftest framework 2022-07-14 14:36:13 -06:00
nsleep-lat.c selftests: timers: Convert nsleep-lat test to generate KTAP output 2023-10-05 15:00:14 -06:00
posix_timers.c selftests:timers: posix_timers: Fix warn_unused_result in __fatal_error() 2024-09-30 11:37:55 -06:00
raw_skew.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
rtcpie.c selftests/timers: remove unused irqcount variable 2024-07-11 11:23:54 -06:00
set-2038.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
set-tai.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
set-timer-lat.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
set-tz.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
settings selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
skew_consistency.c selftests/timers: Remove unused NSEC_PER_SEC macro 2024-09-06 13:37:41 -06:00
threadtest.c kselftest: timers: Fix const correctness 2024-08-21 00:48:48 -06:00
valid-adjtimex.c selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00