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

2018-11-10 Thread Mathieu Desnoyers
- On Nov 9, 2018, at 6:43 PM, Jonathan Rajotte jonathan.rajotte-jul...@efficios.com wrote: >> diff --git a/src/common/utils.c b/src/common/utils.c >> index 3442bef8..5b4e1d3c 100644 >> --- a/src/common/utils.c >> +++ b/src/common/utils.c [...] >> +LTTNG_HIDDEN >> +int timespec_to_ms(struct

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

2018-11-10 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-10 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 (v2)

2018-11-10 Thread Mathieu Desnoyers
- On Nov 9, 2018, at 6:13 PM, Jonathan Rajotte jonathan.rajotte-jul...@efficios.com wrote: > As discussed on IRC, could you make sure to test it manually at least once > since > the problematic scenario is never tested by regression test. > Looks much better than my first attempt but we neve