summaryrefslogtreecommitdiff
path: root/ntpshmread.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-25 07:02:16 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-25 07:02:16 -0500
commit3c88096379eb6209bea197888c5fe6c88898355d (patch)
tree73000b87bd95d33d36e400b568efa968d1d9b3fc /ntpshmread.c
parent2d8bf60a27d43d5b92ab9a40f9c3322d04d7a0d8 (diff)
downloadgpsd-3c88096379eb6209bea197888c5fe6c88898355d.tar.gz
In ntpmon, increase collection time precision and collect the precision field.
Diffstat (limited to 'ntpshmread.c')
-rw-r--r--ntpshmread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ntpshmread.c b/ntpshmread.c
index c6fc06fc..5854df64 100644
--- a/ntpshmread.c
+++ b/ntpshmread.c
@@ -66,8 +66,8 @@ enum segstat_t shm_query(struct shmTime *shm_in, struct shm_stat_t *shm_stat)
unsigned int cns_new, rns_new;
int cnt;
- shm_stat->now = 0;
- time(&shm_stat->now);
+ shm_stat->tvc.tv_sec = shm_stat->tvc.tv_nsec = 0;
+ clock_gettime(CLOCK_REALTIME, &shm_stat->tvc);
if (shm == NULL) {
shm_stat->mode = NO_SEGMENT;
@@ -145,6 +145,7 @@ enum segstat_t shm_query(struct shmTime *shm_in, struct shm_stat_t *shm_stat)
shm->valid = 0;
shm_stat->leap = shm->leap;
+ shm_stat->precision = shm->precision;
shm_stat->mode = OK;
return OK;
}