From: Mathieu Desnoyers Date: Tue, 13 Nov 2018 17:12:20 +0000 (-0500) Subject: Fix: Connect timeout arithmetic in inet/inet6 (v4) X-Git-Tag: v2.12.0-rc1~743 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=2daf65025e0fe5c15179dc4bfb26f875e3d31a26;hp=2daf65025e0fe5c15179dc4bfb26f875e3d31a26 Fix: Connect timeout arithmetic in inet/inet6 (v4) The nanoseconds part of the timespec struct time_a is not always bigger than time_b since it wraps around each second. Use 64-bit arithmetic to compute the difference. Merge/move duplicated code into utils.c. This function is really doing two things. Split it into timespec_to_ms() and timespec_abs_diff(). Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---