summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-09-28 17:33:59 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-09-28 17:33:59 -0400
commitfa02bd8b41017812302961f5c485d829d803437b (patch)
treeabf3fa6ea55b9ed264def91d7b7b8294bd499af8 /gpsutils.c
parentfcbba18745a3f2ead96c032f778237d82895810f (diff)
downloadgpsd-fa02bd8b41017812302961f5c485d829d803437b.tar.gz
GNU libc timegm() turns out to be buggy when DST is on (glibc-2.19).
Fortunately, there's a much simpler way to do the computation correctly. All regression tests pass,
Diffstat (limited to 'gpsutils.c')
-rw-r--r--gpsutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsutils.c b/gpsutils.c
index ab03ecd5..6b72776f 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -321,7 +321,7 @@ timestamp_t iso8601_to_unix( /*@in@*/ char *isotime)
usec = strtod(dp, NULL);
else
usec = 0;
- return (timestamp_t)timegm(&tm) + usec;
+ return (timestamp_t)mktime(&tm) - timezone + usec;
#else
double usec = 0;