From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id AB4D55A0272; Sun, 24 Dec 2023 18:41:07 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] tcp: Cast timeval fields to unsigned long long for printing Date: Sun, 24 Dec 2023 18:41:07 +0100 Message-Id: <20231224174107.1176748-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GJUM4EAMEFDIJ77JD6QEINWTY6WPO2SZ X-Message-ID-Hash: GJUM4EAMEFDIJ77JD6QEINWTY6WPO2SZ X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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. 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); } -- 2.39.2