lib/tst_wallclock.c: Add check for unsupported CLOCK_MONOTONIC_RAW
PATCH 1/1 lib/tst_wallclock.c: Add check for unsupported CLOCK_MONOTONIC_RAW
CLOCK_MONOTONIC_RAW was introduced since kernel v2.6.28, so we want TCONF instead of TBROK if CLOCK_MONOTONIC_RAW wasn't supported on older kernels.
Signed-off-by Xiao Yang <[email protected]>
--- lib/tst_wallclock.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
lib/tst_wallclock.c +7 -1
@@ -25,8 +25,14 @@ void tst_wallclock_save(void)if (tst_clock_gettime (CLOCK_REALTIME , &real_begin))tst_brk (TBROK |TERRNO ,"tst_clock_gettime() realtime failed" ); -if (tst_clock_gettime (CLOCK_MONOTONIC_RAW , &mono_begin)) +if (tst_clock_gettime (CLOCK_MONOTONIC_RAW , &mono_begin)) { +if (errno ==EINVAL ) { +tst_brk (TCONF |TERRNO , +"tst_clock_gettime() didn't support CLOCK_MONOTONIC_RAW" ); + } +tst_brk (TBROK |TERRNO ,"tst_clock_gettime() monotonic failed" ); + } clock_saved =1 ; }
Signature · 1 line
1.7.11.rc0
PATCH 1/1 lib/tst_wallclock.c: Add check for unsupported CLOCK_MONOTONIC_RAW
Hi!
Applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]