]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2782] Refactor refclock_shm.c, add memory barrier protection
authorHarlan Stenn <stenn@ntp.org>
Sat, 7 Mar 2015 23:04:03 +0000 (23:04 +0000)
committerHarlan Stenn <stenn@ntp.org>
Sat, 7 Mar 2015 23:04:03 +0000 (23:04 +0000)
bk: 54fb83e34OI4ziYyO5_1CwxDwAPpDw

ntpd/refclock_shm.c

index 5be0889b3e40debc048fe016b25b552aa05e9e39..270b6cfd6052e740410d28bbc6a575a5ff4ef12b 100644 (file)
@@ -391,7 +391,12 @@ static enum segstat_t shm_query(volatile struct shmTime *shm_in, struct shm_stat
 
     /*@-type@*//* splint is confused about struct timespec */
     shm_stat->tvc.tv_sec = shm_stat->tvc.tv_nsec = 0;
-    get_ostime(&shm_stat->tvc);
+    {
+       time_t now;
+
+       time(&now);
+       shm_stat->tvc.tv_sec = now;
+    }
 
     /* relying on word access to be atomic here */
     if (shm->valid == 0) {