From df4f844daa9ef2d9283bcba543e8df68c9d42b45 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 5 Mar 2022 11:33:19 +0200 Subject: [PATCH] pwtest: ensure all spawned daemons are terminated Set process group, and send signal to them all. --- test/pwtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/pwtest.c b/test/pwtest.c index b834417cd..c711e2f37 100644 --- a/test/pwtest.c +++ b/test/pwtest.c @@ -653,6 +653,8 @@ static pid_t start_pwdaemon(struct pwtest_test *t, int stderr_fd, int log_fd) pid = fork(); if (pid == 0) { /* child */ + setpgid(0, 0); + setenv("PIPEWIRE_CORE", pw_remote, 1); dup2(stderr_fd, STDERR_FILENO); @@ -983,7 +985,7 @@ error: if (pw_daemon > 0) { int status; - kill(pw_daemon, SIGTERM); + kill(-pw_daemon, SIGTERM); r = waitpid(pw_daemon, &status, 0); if (r > 0) { /* write_fds are closed in the parent process, so we append directly */