From 804c0fa71af1c68acdd00bbcfb25f0266090d9c6 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Thu, 16 Jun 2016 21:14:43 -0700 Subject: 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. --- ntpshmmon.c | 2 ++ 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; -- cgit v1.2.1