diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-01-14 17:06:11 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-14 17:06:11 -0500 |
commit | eb3a673af3b681b4e164849d9a5752fa7366e2fe (patch) | |
tree | c31d0fcec21096939f2e601747b11dc8923299ee /gpsutils.c | |
parent | 4c164e09a4fac4f722d550ef3656a8b782cbd35e (diff) | |
download | gpsd-eb3a673af3b681b4e164849d9a5752fa7366e2fe.tar.gz |
Revert to using timegm() following Hal Murray's report of Fedora flakiness.
All regression tests pass.
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -354,10 +354,13 @@ timestamp_t iso8601_to_unix( /*@in@*/ char *isotime) usec = 0; /* - * This could be "return (timestamp_t)timegm(&tm) + usec;" but - * that is glibc only. + * This is a glibc dependency; timegm() is not standard. It would + * be nice if we could say mktime(&tm) - timezone + usec instead, + * but that seems to fail on newer Fedora versions in a way that + * suggests timezone is being set improperly (off by an hour). + * Also timezon is not available at all on some BSDs. */ - return (timestamp_t)mktime(&tm) - timezone + usec; + return (timestamp_t)timegm(&tm) + usec; #else double usec = 0; |