Cruft: There are 3 routines that convert time_t to text

Eric S. Raymond esr at thyrsus.com
Wed Mar 15 16:51:45 UTC 2017


Hal Murray <hmurray at megapathdsl.net>:
> A cleanup opportunity.
> 
> fstostr in ntp_util only called from within ntp_util but defined in ntpd.h
>   %04d%02d%02d%02d%02d
> 
> lstostr in ntp_leapsec only called from within ntp_leapsec
>   %04d-%02d-%02dT%02d:%02dZ
> 
> ctl_putfs in ntp_control only called from within ntp_control
>  %04d%02d%02d%02d%02d

Thanks. I've merged the first two functions and changed the third to use
proper RFC3339 format.  I'd rewrite it more, but the function that was
fstostr has away of reporting out of range that is incompatible with the
was ctl_puts() wants to call it.

> I never figured out what the fs and ls were trying to tell me.  Before the 
> cleanup, the fs were probably converting ntp l_fp epoch times.

No, I don't think I changed those.  Lost in the mists of time...
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.



More information about the devel mailing list