summaryrefslogtreecommitdiff
path: root/sys-apps/rng-tools/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
commitbd4aeefe33e63f613512604e47bfca7b2187697d (patch)
treeadb35b5a9a00ee7ea591ab0c987f70167c23b597 /sys-apps/rng-tools/files
parent48ece6662cbd443015f5a57ae6d8cbdbd69ef37c (diff)
gentoo resync : 03.11.2019
Diffstat (limited to 'sys-apps/rng-tools/files')
-rw-r--r--sys-apps/rng-tools/files/rngd-shutdown.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys-apps/rng-tools/files/rngd-shutdown.patch b/sys-apps/rng-tools/files/rngd-shutdown.patch
new file mode 100644
index 000000000000..ba2fffdd86f6
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd-shutdown.patch
@@ -0,0 +1,37 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=1690364
+
+diff --git a/rngd_jitter.c b/rngd_jitter.c
+index 23d96b3..43a13e0 100644
+--- a/rngd_jitter.c
++++ b/rngd_jitter.c
+@@ -473,26 +473,22 @@ void close_jitter_entropy_source(struct rng *ent_src)
+ for (i=0; i < num_threads; i++)
+ tdata[i].active = 0;
+
+- flags = fcntl(pipefds[1], F_GETFL, 0);
+- flags |= O_NONBLOCK;
+- fcntl(pipefds[1], F_SETFL, &flags);
++ close(pipefds[1]);
+
+ /* And wait for completion of each thread */
+ for (i=0; i < num_threads; i++) {
+ message(LOG_DAEMON|LOG_DEBUG, "Checking on done for thread %d\n", i);
+ while (!tdata[i].done)
++ pthread_kill(threads[i], SIGINT);
+ if(tdata[i].done) {
+ message(LOG_DAEMON|LOG_INFO, "Closing thread %d\n", tdata[i].core_id);
+ pthread_join(threads[i], NULL);
+ jent_entropy_collector_free(tdata[i].ec);
+- } else {
+- read(pipefds[0], tmpbuf, 1024);
++ } else
+ sched_yield();
+- }
+ }
+
+- close(pipefds[2]);
+- close(pipefds[1]);
++ close(pipefds[0]);
+ free(tdata);
+ free(threads);
+ return;