From 010b07d11e259e37d2cd5579b8f2b189342ececb Mon Sep 17 00:00:00 2001 From: Gianfranco Trad Date: Thu, 29 Aug 2024 17:37:25 +0200 Subject: [PATCH] selftests: timers: improve timer_create failure message improve timer_create failure message with strerror() function to give more information to the user. Signed-off-by: Gianfranco Trad Acked-by: John Stultz Signed-off-by: Shuah Khan --- tools/testing/selftests/timers/alarmtimer-suspend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c index 62da2a3f949e..9877158a0853 100644 --- a/tools/testing/selftests/timers/alarmtimer-suspend.c +++ b/tools/testing/selftests/timers/alarmtimer-suspend.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "../kselftest.h" #define CLOCK_REALTIME 0 @@ -142,8 +143,8 @@ int main(void) alarmcount = 0; if (timer_create(alarm_clock_id, &se, &tm1) == -1) { - printf("timer_create failed, %s unsupported?\n", - clockstring(alarm_clock_id)); + printf("timer_create failed, %s unsupported?: %s\n", + clockstring(alarm_clock_id), strerror(errno)); break; }