From 133e238359e16f1dc590a974423839cbde6cc126 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 9 Jun 2025 15:59:22 -0400 Subject: [PATCH] Wait on child process in RAND_poll fork test --- tests/api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/api.c b/tests/api.c index f12ab0bba..e95d014b3 100644 --- a/tests/api.c +++ b/tests/api.c @@ -54,6 +54,7 @@ #ifdef __linux__ #include +#include #endif #include /* compatibility layer */ @@ -33180,6 +33181,7 @@ static int test_wolfSSL_RAND_poll(void) { /* Parent process. */ word64 childrand64 = 0; + int waitstatus = 0; close(pipefds[1]); ExpectIntEQ(RAND_poll(), 1); @@ -33187,6 +33189,7 @@ static int test_wolfSSL_RAND_poll(void) ExpectIntEQ(read(pipefds[0], &childrand64, sizeof(childrand64)), sizeof(childrand64)); ExpectBufNE(randbuf, &childrand64, sizeof(randbuf)); close(pipefds[0]); + waitpid(pid, &waitstatus, 0); } RAND_cleanup();