From: Nikos Mavrogiannopoulos Date: Fri, 25 Jan 2013 20:44:36 +0000 (+0100) Subject: use the more precise gettime() instead of gettimeofday(). X-Git-Tag: gnutls_3_1_7~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9680cc662daba48db160899c75c990e8000eceff;p=thirdparty%2Fgnutls.git use the more precise gettime() instead of gettimeofday(). --- diff --git a/lib/nettle/rnd.c b/lib/nettle/rnd.c index cb8443c2c6..4abeff66c5 100644 --- a/lib/nettle/rnd.c +++ b/lib/nettle/rnd.c @@ -32,6 +32,7 @@ #include #include #include +#include #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) {