Skip to content

Commit 133e238

Browse files
Wait on child process in RAND_poll fork test
1 parent 10b3cc8 commit 133e238

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
#ifdef __linux__
5656
#include <unistd.h>
57+
#include <sys/wait.h>
5758
#endif
5859

5960
#include <wolfssl/ssl.h> /* compatibility layer */
@@ -33180,13 +33181,15 @@ static int test_wolfSSL_RAND_poll(void)
3318033181
{
3318133182
/* Parent process. */
3318233183
word64 childrand64 = 0;
33184+
int waitstatus = 0;
3318333185

3318433186
close(pipefds[1]);
3318533187
ExpectIntEQ(RAND_poll(), 1);
3318633188
ExpectIntEQ(RAND_bytes(randbuf, sizeof(randbuf)), 1);
3318733189
ExpectIntEQ(read(pipefds[0], &childrand64, sizeof(childrand64)), sizeof(childrand64));
3318833190
ExpectBufNE(randbuf, &childrand64, sizeof(randbuf));
3318933191
close(pipefds[0]);
33192+
waitpid(pid, &waitstatus, 0);
3319033193
}
3319133194
RAND_cleanup();
3319233195

0 commit comments

Comments
 (0)