aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianfranco Trad <gianf.trad@gmail.com>2024-08-29 17:37:25 +0200
committerShuah Khan <skhan@linuxfoundation.org>2024-10-14 16:15:12 -0600
commitd70d4218339e657e80ea478e43ec327cf374826b (patch)
tree6a7161dbce06199f2d0420b1d0b1e6c5286611a2
parentselftests: timers: Remove local NSEC_PER_SEC and USEC_PER_SEC defines (diff)
downloadlinux-rng-d70d4218339e657e80ea478e43ec327cf374826b.tar.xz
linux-rng-d70d4218339e657e80ea478e43ec327cf374826b.zip
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>
-rw-r--r--tools/testing/selftests/timers/alarmtimer-suspend.c5
1 files 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 <stdlib.h>
#include <pthread.h>
#include <include/vdso/time64.h>
+#include <errno.h>
#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;
}