summaryrefslogtreecommitdiff
path: root/vtest
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2015-03-16 15:42:34 +1000
committerDave Airlie <airlied@gmail.com>2015-03-17 08:32:39 +1000
commitc73a1d3f8f8b9b0ee0364ce4c99eb27073df4b87 (patch)
treeb480c743ab0554971d19866fc272dd134603cb34 /vtest
parent54d8c08748822d9a55f1f59a5c64fa660592bdcf (diff)
vtest: ignore SIGCHLD
this allows us to ignore the death of the child process and avoid zombies.
Diffstat (limited to 'vtest')
-rw-r--r--vtest/vtest_server.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/vtest/vtest_server.c b/vtest/vtest_server.c
index 0a2ee9a..51d7dc7 100644
--- a/vtest/vtest_server.c
+++ b/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);