summaryrefslogtreecommitdiff
path: root/timebase.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-01-15 05:49:24 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-01-15 05:49:24 -0500
commit8d609c2584b70a77e6d7a524b260d992fff94268 (patch)
tree56f531f749018507f15abbaf5a12dab7b4c1aa74 /timebase.c
parent65b4419c0dcf84c15c03d98d27c9f0197d31f3b6 (diff)
downloadgpsd-8d609c2584b70a77e6d7a524b260d992fff94268.tar.gz
Move the timezone swetting to where we keep our assumptions abouut time.
Diffstat (limited to 'timebase.c')
-rw-r--r--timebase.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/timebase.c b/timebase.c
index 13c156b7..a3378bc5 100644
--- a/timebase.c
+++ b/timebase.c
@@ -87,6 +87,13 @@ BSD terms apply: see the file COPYING in the distribution root for details.
void gpsd_time_init(struct gps_context_t *context, time_t starttime)
/* initialize the GPS context's time fields */
{
+ /*
+ * gpsd can't work with 'right' timezones (leapseconds inserted in
+ * the timezone offset). Avoid this and all manner of other local
+ * time issues by telling the system we want times returned in UTC.
+ */
+ (void)putenv("TZ=UTC");
+
/*
* Provides a start time for getting the century. Do this, just
* in case one of our embedded deployments is still in place in