aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random/unit_test.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2015-08-17 07:36:12 +0000
committerMark Murray <markm@FreeBSD.org>2015-08-17 07:36:12 +0000
commit646041a89aeab0d79fa350c401de57e1c8b85ac2 (patch)
tree607f453932abecc199a5542abc16308de508677e /sys/dev/random/unit_test.c
parent7a40703db93b4c09f516a89084d01faa533ed195 (diff)
Notes
Diffstat (limited to 'sys/dev/random/unit_test.c')
-rw-r--r--sys/dev/random/unit_test.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/sys/dev/random/unit_test.c b/sys/dev/random/unit_test.c
index 7ae571677049..fac4c8d77d3c 100644
--- a/sys/dev/random/unit_test.c
+++ b/sys/dev/random/unit_test.c
@@ -46,6 +46,7 @@ Where <alg> is YARROW or FORTUNA.
#include <sys/types.h>
#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <threads.h>
@@ -172,35 +173,6 @@ RunHarvester(void *arg __unused)
}
static int
-WriteCSPRNG(void *threadid)
-{
- uint8_t *buf;
- int i;
-
- printf("Thread #1 starts\n");
-
- for (i = 0; ; i++) {
- if (stopseeding)
- break;
- buf = malloc(4096);
- if (i % 1000 == 0)
- printf("Thread write 1 - %d\n", i);
- if (buf != NULL) {
- printf("Thread 1 writing.\n");
- random_alg_context.ra_write(buf, i);
- free(buf);
- }
- usleep(1000000);
- }
-
- printf("Thread #1 ends\n");
-
- thrd_exit(0);
-
- return (0);
-}
-
-static int
ReadCSPRNG(void *threadid)
{
size_t tid, zsize;
@@ -271,7 +243,7 @@ main(int argc, char *argv[])
for (t = 0; t < NUM_THREADS; t++) {
printf("In main: creating thread %ld\n", t);
- rc = thrd_create(&threads[t], (t == 0 ? RunHarvester : (t == 1 ? WriteCSPRNG : ReadCSPRNG)), NULL);
+ rc = thrd_create(&threads[t], (t == 0 ? RunHarvester : ReadCSPRNG), NULL);
if (rc != thrd_success) {
printf("ERROR; return code from thrd_create() is %d\n", rc);
exit(-1);