Re: [PATCH] readutmp: work around glibc utmpx bug

2023-07-31 Thread Bruno Haible
> * tests/test-readutmp.c: New file. I had missed the fact that the 'ut_line' field is portable (and coreutils uses it in the 'who' and 'pinky' programs). So, it has to be included in the unit test. 2023-07-31 Bruno Haible readutmp tests: Show also the ut_line field. *

Re: [PATCH] readutmp: work around glibc utmpx bug

2023-07-31 Thread Bruno Haible
I wrote: > * The test fails on OpenBSD 7.2, because the smallest time in the entries > is 1970-01-01. With this patch, the unit test passes on OpenBSD. 2023-07-31 Bruno Haible readutmp: Fix test failure on OpenBSD. * lib/readutmp.c (desirable_utmp_entry): On OpenBSD, elimin

readutmp: Revisit portability

2023-07-31 Thread Bruno Haible
It wasn't clear to me, from looking it readutmp.h, that programs could portably rely on the UT->ut_line member. To clarify this, here are some doc updates. Also, since there's no system that has 'struct utmp.ut_exit.ut_*', let me remove these configure tests. (The only platform that has 'struct ut

Re: bug#64954: GNU 'uptime' on OpenBSD always prints "0 users"

2023-07-31 Thread Paul Eggert
Thanks, I propagated that into Coreutils and installed the simplified patch I mentioned yesterday. Closing the coreutils bug report.

readutmp: Make argument names consistent

2023-07-31 Thread Bruno Haible
In the readutmp.h macros, the same entity (pointer to an utmp or utmpx entry) is - sometimes named U, - sometimes named UT, - sometimes named UT_PTR, - sometimes named Utmp. This is valid, but makes reading the code unnecessarily hard. 2023-07-31 Bruno Haible readutmp: Make ar

Re: bug#64954: GNU 'uptime' on OpenBSD always prints "0 users"

2023-07-31 Thread Bruno Haible
I wrote in : > - Gnulib modules should better provide .h files that can be #included > on any platform. Thus, it's Gnulib's task to provide a readutmp.h > and a read_utmp() function that can also be used on native Windows. Done as foll

Re: bug#64937: "who" reports funny dates

2023-07-31 Thread Thorsten Kukuk
Hi, On Sun, Jul 30, Paul Eggert wrote: > Thorsten's draft coreutils patches > are a bit > long, and I'm hoping we can simplify this by packaging the fix inside > Gnulib (much as we already packaged the fix for not working on >

Re: bug#64937: "who" reports funny dates

2023-07-31 Thread Paul Eggert
On 2023-07-31 00:08, Thorsten Kukuk wrote: 1. you need to extend ut_tv from 32bit time_t to 64bit time_t, or your patch will not survive 2038. Yes, that's the plan. Gnulib's readutmp module already does this, in apps that also use the year2038 or year2038-recommended modules (which most do).