Remove a bad use of tv_nsec.
authorJason S. Ninneman <jsn@mbar.us>
Wed, 24 May 2017 06:46:20 +0000 (23:46 -0700)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 23 Mar 2023 15:28:53 +0000 (11:28 -0400)
misc.c

diff --git a/misc.c b/misc.c
index 7d9f4eccff4b1be06b395aa19cfb7e46808a9c70..18bdd7aa2adb066b1ac2cb2ed5f74ad44fa67320 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -761,9 +761,7 @@ long TSTBIT;
 void set_seed_from_time(void)
 {
   /* Use the current system time to get seed the ISO rand() function, from which we get a seed for the LCG. */
-  struct timespec ts;
-  clock_gettime(CLOCK_REALTIME, &ts);
-  srand(ts.tv_nsec);
+  srand(time(NULL));
   lcgstate.x = (unsigned long) rand() % lcgstate.m;
 }