From: Mathieu Desnoyers Date: Tue, 13 Mar 2012 20:11:37 +0000 (-0400) Subject: Fix clock offset 32-bit multiplication overflow X-Git-Tag: v2.0.0-rc4~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=57be518d19d7c433f79c57cd7815160110ac19c2;p=lttng-modules.git Fix clock offset 32-bit multiplication overflow Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-events.c b/lttng-events.c index ea6c116f..2fedbea5 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -887,7 +887,7 @@ uint64_t measure_clock_offset(void) local_irq_restore(flags); offset = (monotonic[0] + monotonic[1]) >> 1; - realtime = rts.tv_sec * NSEC_PER_SEC; + realtime = (uint64_t) rts.tv_sec * NSEC_PER_SEC; realtime += rts.tv_nsec; offset = realtime - offset; return offset;