]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
use the more precise gettime() instead of gettimeofday().
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 25 Jan 2013 20:44:36 +0000 (21:44 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 25 Jan 2013 20:44:36 +0000 (21:44 +0100)
lib/nettle/rnd.c

index cb8443c2c619b80a77992e2d8c82102e2f4a453b..4abeff66c5ca913c15e74198280ed3b73d5b6084 100644 (file)
@@ -32,6 +32,7 @@
 #include <locks.h>
 #include <gnutls_num.h>
 #include <nettle/yarrow.h>
+#include <timespec.h>
 
 #define SOURCES 2
 
@@ -172,7 +173,7 @@ do_trivia_source (int init)
 {
   struct
   {
-    struct timeval now;
+    struct timespec now;
 #ifdef HAVE_GETRUSAGE
     struct rusage rusage;
 #endif
@@ -182,11 +183,7 @@ do_trivia_source (int init)
 
   unsigned entropy = 0;
 
-  if (gettimeofday (&event.now, NULL) < 0)
-    {
-      _gnutls_debug_log ("gettimeofday failed: %s\n", strerror (errno));
-      abort ();
-    }
+  gettime (&event.now);
 #ifdef HAVE_GETRUSAGE
   if (getrusage (RUSAGE_SELF, &event.rusage) < 0)
     {