]> git.sur5r.net Git - openldap/commitdiff
Don't use sig_atomic_t.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 27 Oct 1999 21:50:49 +0000 (21:50 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 27 Oct 1999 21:50:49 +0000 (21:50 +0000)
Comment upon synchronization issue.
Fix gettimeofday usage.

libraries/liblutil/entropy.c

index 23e5cb4a0c7bb2fbafff0d6fdac0894ca38830db..56502d32178c810050950b80299f93db4ca89e4e 100644 (file)
@@ -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