diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-01 23:57:01 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-01 23:57:01 -0500 |
commit | 44b3532e07d2e3790a75ccd5a75f19deefa71e82 (patch) | |
tree | 3d1bd2eaf9a5134dbcee9247e5f31343c7e96fde /libgpsd_core.c | |
parent | 4964c68cf4ebca29d745ba02c4ba3da4a68e9abd (diff) | |
download | gpsd-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.c | 6 |
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 |