public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH] tcp: Cast timeval fields to unsigned long long for printing
Date: Wed, 27 Dec 2023 14:40:17 +1100	[thread overview]
Message-ID: <ZYucoco0sRrIvXnV@zatzit> (raw)
In-Reply-To: <20231224174107.1176748-1-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

On Sun, Dec 24, 2023 at 06:41:07PM +0100, Stefano Brivio wrote:
> 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 <sbrivio@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  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);
>  }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-12-27  3:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-24 17:41 [PATCH] tcp: Cast timeval fields to unsigned long long for printing Stefano Brivio
2023-12-27  3:40 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZYucoco0sRrIvXnV@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).