]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Another RANDOM -> ntp_random()
authorHarlan Stenn <stenn@ntp.org>
Wed, 3 Aug 2005 01:48:09 +0000 (21:48 -0400)
committerHarlan Stenn <stenn@ntp.org>
Wed, 3 Aug 2005 01:48:09 +0000 (21:48 -0400)
bk: 42f02259Ui-Hzl54ZMUY5_hU-0k3oQ

libntp/systime.c

index 62acc8da89647d4244dca4884f4ecb640b4579e5..2c21c4f0824bedab4f136a9a5b6b8f03e1137305 100644 (file)
@@ -80,7 +80,8 @@ get_systime(
         */
        GETTIMEOFDAY(&tv, NULL);
        now->l_i = tv.tv_sec + JAN_1970;
-       dtemp = (tv.tv_usec + (RANDOM & 0xffffffff) / FRAC - .5) / 1e6;
+       /* ntp_random() produces 31 bits (always nonnegative) */
+       dtemp = (tv.tv_usec + ntp_random() / FRAC - .5) / 1e6;
 
 #endif /* HAVE_CLOCK_GETTIME || HAVE_GETCLOCK */