[lttng-dev] [PATCH lttng-tools 1/2] Fix: Connect timeout arithmetic in inet/inet6 (v4)

2018-11-13 Thread Mathieu Desnoyers
The nanoseconds part of the timespec struct time_a is not always bigger than time_b since it wrap around each seconds. Use 64-bit arithmetic to perform the difference. Merge/move duplicated code into utils.c. This function is really doing two things. Split it into timespec_to_ms() and timespec_a

[lttng-dev] [PATCH lttng-tools 2/2] Fix: max_t/min_t macros are missing cast on input

2018-11-13 Thread Mathieu Desnoyers
The semantic expected from max_t and min_t is to perform the max/min comparison in the type provided as first parameter. Cast the input parameters to the proper type before comparing them, rather than after. There is no more need to cast the result of the expression now that both inputs are cast t

Re: [lttng-dev] [PATCH lttng-tools 1/2] Fix: Connect timeout arithmetic in inet/inet6 (v4)

2018-11-13 Thread Jonathan Rajotte-Julien
Acked-by: Jonathan Rajotte On Tue, Nov 13, 2018 at 12:12:20PM -0500, Mathieu Desnoyers wrote: > The nanoseconds part of the timespec struct time_a is not always > bigger than time_b since it wrap around each seconds. > > Use 64-bit arithmetic to perform the difference. > > Merge/move duplicated