From fd29d62a9d4e0359f27db0df11803326150e9e56 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 24 Dec 2023 18:13:43 +0100 Subject: tcp: Cast timeval fields to unsigned long long for printing On x32, glibc defines time_t and suseconds_t (the latter, also known as __syscall_slong_t) as unsigned long long, whereas "everywhere else", including x86_64 and i686, those are unsigned long. See also https://sourceware.org/bugzilla/show_bug.cgi?id=16437 for all the gory details. Reviewed-by: David Gibson Signed-off-by: Stefano Brivio --- tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tcp.c b/tcp.c index f506cfd..1e4d2fa 100644 --- a/tcp.c +++ b/tcp.c @@ -727,8 +727,9 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) it.it_value.tv_sec = ACT_TIMEOUT; } - flow_dbg(conn, "timer expires in %lu.%03lus", it.it_value.tv_sec, - it.it_value.tv_nsec / 1000 / 1000); + flow_dbg(conn, "timer expires in %llu.%03llus", + (unsigned long long)it.it_value.tv_sec, + (unsigned long long)it.it_value.tv_nsec / 1000 / 1000); timerfd_settime(conn->timer, 0, &it, NULL); } -- cgit v1.2.3