Fix clock offset 32-bit multiplication overflow
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Mar 2012 20:11:37 +0000 (16:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Mar 2012 20:11:37 +0000 (16:11 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-events.c

index ea6c116fdf4d008196e8973f0024a7b0d69a88a6..2fedbea59202df8da309a6b24fb348b37db1092c 100644 (file)
@@ -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;
This page took 0.027322 seconds and 4 git commands to generate.