From: Mathieu Desnoyers Date: Wed, 21 Dec 2011 21:24:48 +0000 (-0500) Subject: Fix clock source overflow on 32-bit archs X-Git-Tag: v1.9.3~1 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=dc190cc1f8ddccfa7b0b8323ed157afb29a0ebb7;hp=edc1b654ae3ec35b88b67056d0f662aca65743f8;p=lttng-ust.git Fix clock source overflow on 32-bit archs Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/clock.h b/liblttng-ust/clock.h index b5d3e77c..23294d2b 100644 --- a/liblttng-ust/clock.h +++ b/liblttng-ust/clock.h @@ -39,7 +39,7 @@ static __inline__ uint64_t trace_clock_read64(void) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return (ts.tv_sec * 1000000000) + ts.tv_nsec; + return ((uint64_t) ts.tv_sec * 1000000000ULL) + ts.tv_nsec; } static __inline__ uint32_t trace_clock_freq_scale(void)