summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-25 21:44:36 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-01-25 21:44:36 +0100
commit9680cc662daba48db160899c75c990e8000eceff (patch)
treed338d236f00af1d6b143a7f3d45668f526e134fe
parentc73b48d83fb3f07bbf3380070aad4bef94562660 (diff)
downloadgnutls-9680cc662daba48db160899c75c990e8000eceff.tar.gz
use the more precise gettime() instead of gettimeofday().
-rw-r--r--lib/nettle/rnd.c9
1 files changed, 3 insertions, 6 deletions
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 <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)
{