diff --git a/src/libguac/tests/socket/nested_send_instruction.c b/src/libguac/tests/socket/nested_send_instruction.c index 14e876b25..fe94f6e5b 100644 --- a/src/libguac/tests/socket/nested_send_instruction.c +++ b/src/libguac/tests/socket/nested_send_instruction.c @@ -22,6 +22,7 @@ #include #include +#include #include /** @@ -123,6 +124,7 @@ static void read_expected_instructions(int fd) { void test_socket__nested_send_instruction() { int fd[2]; + int return_status; /* Create pipe */ CU_ASSERT_EQUAL_FATAL(pipe(fd), 0); @@ -141,6 +143,9 @@ void test_socket__nested_send_instruction() { exit(0); } + /* Wait for child to finish */ + waitpid(childpid, &return_status, 0); + /* Read and verify the expected instructions within the parent process */ close(write_fd); read_expected_instructions(read_fd);