vtest: ignore SIGCHLD

this allows us to ignore the death of the child process
and avoid zombies.
macos/master
Dave Airlie 10 years ago
parent 54d8c08748
commit c73a1d3f8f
  1. 11
      vtest/vtest_server.c

@ -1,4 +1,5 @@
#include <stdio.h>
#include <signal.h>
#include <stdbool.h>
#include <unistd.h>
#include <stdlib.h>
@ -143,6 +144,16 @@ int main(void)
{
int sock, new_fd, ret;
pid_t pid;
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGCHLD, &sa, 0) == -1) {
perror(0);
exit(1);
}
sock = vtest_open_socket("/tmp/.virgl_test");
restart:
new_fd = wait_for_socket_accept(sock);

Loading…
Cancel
Save