Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gianf.trad@gmail.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Gianfranco Trad and committed by
Shuah Khan
d70d4218 80fa614e

+3 -2
+3 -2
tools/testing/selftests/timers/alarmtimer-suspend.c
··· 29 29 #include <stdlib.h> 30 30 #include <pthread.h> 31 31 #include <include/vdso/time64.h> 32 + #include <errno.h> 32 33 #include "../kselftest.h" 33 34 34 35 #define CLOCK_REALTIME 0 ··· 143 142 144 143 alarmcount = 0; 145 144 if (timer_create(alarm_clock_id, &se, &tm1) == -1) { 146 - printf("timer_create failed, %s unsupported?\n", 147 - clockstring(alarm_clock_id)); 145 + printf("timer_create failed, %s unsupported?: %s\n", 146 + clockstring(alarm_clock_id), strerror(errno)); 148 147 break; 149 148 } 150 149