mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
queue-test: WEXITSTATUS() is undefined if WIFEXITED() is false
If a child process dies from a signal, WIFEXITED() returns false and WEXITSTATUS() isn't well-defined. In this case, if the client segfaults, the status is 134 and WEXITSTATUS(134) is EXIT_SUCCESS, so we mask the error.
This commit is contained in:
parent
f02f82ef78
commit
adcb2d73b3
1 changed files with 3 additions and 2 deletions
|
|
@ -212,7 +212,7 @@ sigchld_handler(int signal_number, void *data)
|
|||
int status;
|
||||
|
||||
waitpid(-1, &status, 0);
|
||||
display->child_exit_status = WEXITSTATUS(status);
|
||||
display->child_exit_status = status;
|
||||
|
||||
wl_display_terminate(display->display);
|
||||
|
||||
|
|
@ -282,5 +282,6 @@ TEST(queue)
|
|||
wl_event_source_remove(signal_source);
|
||||
wl_display_destroy(display.display);
|
||||
|
||||
assert(display.child_exit_status == EXIT_SUCCESS);
|
||||
assert(WIFEXITED(display.child_exit_status) &&
|
||||
WEXITSTATUS(display.child_exit_status) == EXIT_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue