From: Kurt Zeilenga Date: Wed, 27 Oct 1999 21:50:49 +0000 (+0000) Subject: Don't use sig_atomic_t. X-Git-Tag: UCDATA_2_4~308 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=68a569c738b5a636bcb31d28e8dfc790f0d58b9e;p=openldap Don't use sig_atomic_t. Comment upon synchronization issue. Fix gettimeofday usage. --- 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