[LTP] [PATCH] futex_wake04: avoid tst_ts_from_ns overflow on 32-bit platforms

Cyril Hrubis chrubis@suse.cz
Wed Jun 9 10:23:06 CEST 2021


Hi!
Good catch, I guess that it would be slightly cleaner to fix the
NSEC_PER_SEC size instead with:

diff --git a/include/lapi/common_timers.h b/include/lapi/common_timers.h
index b783beff4..e50f698d6 100644
--- a/include/lapi/common_timers.h
+++ b/include/lapi/common_timers.h
@@ -12,7 +12,7 @@
 #include "lapi/posix_clocks.h"

 #ifndef NSEC_PER_SEC
-#define NSEC_PER_SEC (1000000000L)
+#define NSEC_PER_SEC (1000000000LL)
 #endif

 static const clock_t clock_list[] = {


What do you think?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list