diff options
author | Gary E. Miller <gem@rellim.com> | 2016-06-16 21:14:43 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-06-16 21:14:43 -0700 |
commit | 804c0fa71af1c68acdd00bbcfb25f0266090d9c6 (patch) | |
tree | 086d6b478bd2df4d18ff5ebad7681af8b723ad63 | |
parent | cb848db6eacc9cb755a8bb4a1354ab7fd18342fe (diff) | |
download | gpsd-804c0fa71af1c68acdd00bbcfb25f0266090d9c6.tar.gz |
Only read the system clock for tvc is we are going to use it.
Stop reading time that is just going to be thrown away.
-rw-r--r-- | ntpshmmon.c | 2 | ||||
-rw-r--r-- | ntpshmread.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ntpshmmon.c b/ntpshmmon.c index f46bf1ca..e9234c89 100644 --- a/ntpshmmon.c +++ b/ntpshmmon.c @@ -112,6 +112,8 @@ int main(int argc, char **argv) /* no change in tvt */ break; } + /* time stamp it */ + clock_gettime(CLOCK_REALTIME, &shm_stat.tvc); printf("%s %ld.%09ld %ld.%09ld %ld.%09ld %d %3d\n", ntp_name(i), (long)shm_stat.tvc.tv_sec, shm_stat.tvc.tv_nsec, diff --git a/ntpshmread.c b/ntpshmread.c index 7e5ceff6..8283b6b4 100644 --- a/ntpshmread.c +++ b/ntpshmread.c @@ -67,8 +67,6 @@ enum segstat_t ntp_read(struct shmTime *shm_in, struct shm_stat_t *shm_stat, con shm_stat->tvc.tv_sec = shm_stat->tvc.tv_nsec = 0; - clock_gettime(CLOCK_REALTIME, &shm_stat->tvc); - /* relying on word access to be atomic here */ if (shm->valid == 0) { shm_stat->status = NOT_READY; |