From 57be518d19d7c433f79c57cd7815160110ac19c2 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 13 Mar 2012 16:11:37 -0400 Subject: [PATCH] Fix clock offset 32-bit multiplication overflow Signed-off-by: Mathieu Desnoyers --- lttng-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1