summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-01 23:57:01 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-01 23:57:01 -0500
commit44b3532e07d2e3790a75ccd5a75f19deefa71e82 (patch)
tree3d1bd2eaf9a5134dbcee9247e5f31343c7e96fde /libgpsd_core.c
parent4964c68cf4ebca29d745ba02c4ba3da4a68e9abd (diff)
downloadgpsd-44b3532e07d2e3790a75ccd5a75f19deefa71e82.tar.gz
Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X).
On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 210aa596..a1a1a44e 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1658,13 +1658,7 @@ void ntp_latch(struct gps_device_t *device, struct timedelta_t /*@out@*/*td)
/* this should be an invariant of the way this function is called */
assert(isnan(device->newdata.time)==0);
-#ifdef HAVE_CLOCK_GETTIME
/*@i2@*/(void)clock_gettime(CLOCK_REALTIME, &td->clock);
-#else
- struct timeval clock_tv;
- (void)gettimeofday(&clock_tv, NULL);
- TVTOTS(&td->clock, &clock_tv);
-#endif /* HAVE_CLOCK_GETTIME */
fix_time = device->newdata.time;
#ifdef TIMEHINT_ENABLE