Skip to content

Commit

Permalink
Test exit status of child in linux.clone test (#6515)
Browse files Browse the repository at this point in the history
In the linux.clone testcase, if the child crashes or exits with a
non-zero exit code,
the test would otherwise get marked as passing.
  • Loading branch information
xdje42 authored Dec 20, 2023
1 parent 053edba commit 4e6ad10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion suite/tests/linux/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,13 @@ delete_thread(pid_t pid, void *stack)
{
pid_t result;
/* do not print out pids to make diff easy */
result = waitpid(pid, NULL, 0);
int wait_status;
result = waitpid(pid, &wait_status, 0);
print("Child has exited\n");
if (result == -1 || result != pid)
perror("delete_thread waitpid");
else if (!WIFEXITED(wait_status) || WEXITSTATUS(wait_status) != 0)
print("delete_thread bad wait_status: 0x%x\n", wait_status);
stack_free(stack, THREAD_STACK_SIZE);
}

Expand Down

0 comments on commit 4e6ad10

Please sign in to comment.