Paul Eggert wrote: > On 08/17/2012 10:46 AM, Bruce Dubbs wrote: >> I've never seen the M parameters in TZ before. What do they do? > > They specify the time zone rules directly, without consulting > the tz database. Unlike the tz database, they're specified by > POSIX, so they should be more portable. Also, POSIX says they > ignore leap seconds so they should not have a leap second glitch. > > I suspect you've found a glibc bug in its handling of tm_gmtoff > and/or localtime-vs-gmtime when leap seconds are enabled, > which you're welcome to report. > > This code is supposed to be testing parse-datetime, not > for glibc bugs, so I pushed the following patch into gnulib > and am marking this as done. The fix should be propagated into > coreutils the next time it syncs from gnulib. > > test-parse-datetime: avoid glibc leap-second glitch > * tests/test-parse-datetime.c (main): Set TZ to US Eastern time > with the 2012 rules. Problem reported by Bruce Dubbs in > <http://bugs.gnu.org/12206>. > diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c > index 1c9fd2d..98ce64b 100644 > --- a/tests/test-parse-datetime.c > +++ b/tests/test-parse-datetime.c > @@ -123,6 +123,12 @@ main (int argc _GL_UNUSED, char **argv) > > set_program_name (argv[0]); > > + /* Set the time zone to US Eastern time with the 2012 rules. This > + should disable any leap second support. Otherwise, there will be > + a problem with glibc on sites that default to leap seconds; see > + <http://bugs.gnu.org/12206>. */ > + setenv ("TZ", "EST5EDT,M3.2.0,M11.1.0", 1); > + > gmtoff = gmt_offset (ref_time);
Thanks for the quick fix, Paul. This will be fixed in coreutils-8.19, coming soon.
