summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c3
-rw-r--r--timebase.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 1e60e179..e71ecb96 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1997,9 +1997,6 @@ int main(int argc, char *argv[])
#endif /* defined(CONTROL_SOCKET_ENABLE) || defined(SYSTEMD_ENABLE) */
- /* gpsd can't work with 'right' timezone when leapseconds inserted */
- (void)putenv("TZ=UTC");
-
/* might be time to daemonize */
if (go_background) {
/* not SuS/POSIX portable, but we have our own fallback version */
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