1From bbe989be6ca5e093d5244413590bd80e12c2ec9b Mon Sep 17 00:00:00 2001
2From: Will Dietz <w@wdtz.org>
3Date: Sun, 17 Jun 2018 18:53:58 -0500
4Subject: [PATCH] rndjent: move locking to fix trying to obtain held lock,
5 hanging
6
7---
8 random/rndjent.c | 3 ++-
9 1 file changed, 2 insertions(+), 1 deletion(-)
10
11diff --git a/random/rndjent.c b/random/rndjent.c
12index 0c5a820b..3740ddd4 100644
13--- a/random/rndjent.c
14+++ b/random/rndjent.c
15@@ -334,9 +334,10 @@ _gcry_rndjent_get_version (int *r_active)
16 {
17 if (r_active)
18 {
19- lock_rng ();
20 /* Make sure the RNG is initialized. */
21 _gcry_rndjent_poll (NULL, 0, 0);
22+
23+ lock_rng ();
24 /* To ease debugging we store 2 for a clock_gettime based
25 * implementation and 1 for a rdtsc based code. */
26 *r_active = jent_rng_collector? is_rng_available () : 0;
27--
282.18.0-rc2
29