mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
pwtest: ensure all spawned daemons are terminated
Set process group, and send signal to them all.
This commit is contained in:
parent
24fd273820
commit
df4f844daa
|
@ -653,6 +653,8 @@ static pid_t start_pwdaemon(struct pwtest_test *t, int stderr_fd, int log_fd)
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
/* child */
|
/* child */
|
||||||
|
setpgid(0, 0);
|
||||||
|
|
||||||
setenv("PIPEWIRE_CORE", pw_remote, 1);
|
setenv("PIPEWIRE_CORE", pw_remote, 1);
|
||||||
|
|
||||||
dup2(stderr_fd, STDERR_FILENO);
|
dup2(stderr_fd, STDERR_FILENO);
|
||||||
|
@ -983,7 +985,7 @@ error:
|
||||||
if (pw_daemon > 0) {
|
if (pw_daemon > 0) {
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
kill(pw_daemon, SIGTERM);
|
kill(-pw_daemon, SIGTERM);
|
||||||
r = waitpid(pw_daemon, &status, 0);
|
r = waitpid(pw_daemon, &status, 0);
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
/* write_fds are closed in the parent process, so we append directly */
|
/* write_fds are closed in the parent process, so we append directly */
|
||||||
|
|
Loading…
Reference in a new issue