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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
60925b8b4e
commit
fd29d62a9d
1 changed files with 3 additions and 2 deletions
5
tcp.c
5
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;
|
it.it_value.tv_sec = ACT_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
flow_dbg(conn, "timer expires in %lu.%03lus", it.it_value.tv_sec,
|
flow_dbg(conn, "timer expires in %llu.%03llus",
|
||||||
it.it_value.tv_nsec / 1000 / 1000);
|
(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);
|
timerfd_settime(conn->timer, 0, &it, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue