Previously, we would only attempt to use symlink metadata when reading
from /etc/localtime explicitly. We didn't do this when TZ is set to a
path. And in particular, TZ might actually be set to /etc/localtime,
in which case, it's likely a symlink. And we can detect the IANA time
zone identifier from the symlink in most cases. Just like we would by
default if TZ wasn't set.
I originally didn't do this because the code for handling TZ was
actually completely platform independent, so it didn't occur to me to do
something platform specific on Unix. But it's not too hard to do.
While setting TZ=/etc/localtime is odd, apparently this is given as
advice to folks for libc to avoid repeatedly reading /etc/localtime to
check for updates. Seems weird to me, but whatever. Jiff should try to
detect symlink metadata regardless of libc shenanigans.
Previously, we would only attempt to use symlink metadata when reading from /etc/localtime explicitly. We didn't do this when
TZ
is set to a path. And in particular,TZ
might actually be set to/etc/localtime
, in which case, it's likely a symlink. And we can detect the IANA time zone identifier from the symlink in most cases. Just like we would by default ifTZ
wasn't set.I originally didn't do this because the code for handling
TZ
was actually completely platform independent, so it didn't occur to me to do something platform specific on Unix. But it's not too hard to do.While setting
TZ=/etc/localtime
is odd, apparently this is given as advice to folks for libc to avoid repeatedly reading/etc/localtime
to check for updates. Seems weird to me, but whatever. Jiff should try to detect symlink metadata regardless of libc shenanigans.Fixes #113