Ingo Schwarze wrote:
> Now let's get to the more serious part.
> Hiltjo observed that %Z and %z produce wrong results.
> 
> First of all, neither POSIX nor XPG define tm_gmtoff nor %Z nor %z:
> 
>   https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
>   https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
> 
> So i think the best way to find out what tm_gmtoff should be is to
> understand how programs in our own tree use it.
> 
> Here is a (hopefully) complete list of the users in OpenBSD base.
> The following files expect it to contain seconds:
>  - lib/libc/time/strftime.c
>  - lib/libc/time/wcsftime.c
>  - usr.sbin/smtpd/to.c
>  - usr.sbin/snmpd/mib.c
>  - usr.sbin/cron/cron.c
>  - usr.bin/ftp/util.c
>  - usr.bin/cvs/entries.c
>  - usr.bin/rcs/rcstime.c
>  - gnu/usr.bin/perl/time64.c
> 
> I failed to find any users that do *not* expect seconds.
> So my conclusion is that the documentation is right and
> what the code in strptime.c does is wrong.
> 
> Here is a patch to fix the code.

this looks good to me. ok.

Reply via email to