Date: Sun, 12 May 2024 14:37:11 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Warner Losh <imp@freebsd.org> 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: <ZkCp50M1tkhQWyTV@kib.kiev.ua> In-Reply-To: <202405120457.44C4vJHL090872@gitrepo.freebsd.org> References: <202405120457.44C4vJHL090872@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <imp@FreeBSD.org> > AuthorDate: 2024-05-12 04:53:15 +0000 > Commit: Warner Losh <imp@FreeBSD.org> > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZkCp50M1tkhQWyTV>