From 68a569c738b5a636bcb31d28e8dfc790f0d58b9e Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 27 Oct 1999 21:50:49 +0000 Subject: [PATCH] Don't use sig_atomic_t. Comment upon synchronization issue. Fix gettimeofday usage. --- libraries/liblutil/entropy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/liblutil/entropy.c b/libraries/liblutil/entropy.c index 23e5cb4a0c..56502d3217 100644 --- a/libraries/liblutil/entropy.c +++ b/libraries/liblutil/entropy.c @@ -79,7 +79,12 @@ int lutil_entropy( char *buf, int nbytes ) * MD5 is a strong cryptographic hash, this should * be fairly resistant to attack */ - static sig_atomic_t counter = 0; + + /* + * the caller may be provide external synchronization OR + * provide entropy (in buf) to ensure quality results. + */ + static int counter = 0; int n; struct rdata_s { @@ -91,7 +96,7 @@ int lutil_entropy( char *buf, int nbytes ) pid_t pid; #ifdef HAVE_GETTIMEOFDAY - struct timeval *tv; + struct timeval tv; #else time_t time; #endif -- 2.39.5