From nobody Sun May 12 11:37:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcgZk36j3z5JN89; Sun, 12 May 2024 11:37:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VcgZk156Tz412d; Sun, 12 May 2024 11:37:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 44CBbBLn067515; Sun, 12 May 2024 14:37:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 44CBbBLn067515 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 44CBbBYo067514; Sun, 12 May 2024 14:37:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 May 2024 14:37:11 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ee2e36686e84 - main - linprocfs: Really fix time_t type issue Message-ID: References: <202405120457.44C4vJHL090872@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202405120457.44C4vJHL090872@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4VcgZk156Tz412d On Sun, May 12, 2024 at 04:57:19AM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ee2e36686e846d412deac23344185f4b8a8c0285 > > commit ee2e36686e846d412deac23344185f4b8a8c0285 > Author: Warner Losh > AuthorDate: 2024-05-12 04:53:15 +0000 > Commit: Warner Losh > CommitDate: 2024-05-12 04:53:15 +0000 > > linprocfs: Really fix time_t type issue > > The cast to (long) is wrong on all the other 32-bit platforms. (long > long) is the correct type on all platforms. Also, use a z modifier for > size_t which also fails on 32-bit platforms. > > Fixes: 02f481a30b82 > Sponsored by: Netflix > --- > sys/compat/linprocfs/linprocfs.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c > index aa5af0b3c1c1..dd04adc054db 100644 > --- a/sys/compat/linprocfs/linprocfs.c > +++ b/sys/compat/linprocfs/linprocfs.c > @@ -2133,7 +2133,7 @@ again: > for (id = 0; id < msgmni; id++) > if (msqids[id].u.msg_qbytes != 0) > sbuf_printf(sb, > - "%10d %10lu %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10ld %10ld %10ld\n", > + "%10d %10lu %4o %10lu %10lu %5u %5u %5u %5u %5u %5u %10lld %10lld %10lld\n", > (int) msqids[id].u.msg_perm.key, > IXSEQ_TO_IPCID(id, msqids[id].u.msg_perm), > msqids[id].u.msg_perm.mode, The canonical and bde' approved way to print integrals which size if MD is to use %jd format modifier and cast to intmax_t.