From 9e279f212f2c35d1972a5fe4e9ebd09e37d20d15 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 30 Jun 2023 01:15:48 +0200 Subject: use __WNOTHREAD w/ waitpid I learned about this flag on my previous job; basically, it should be enabled by default IMO, so that the thread doesn't receive signals from other threads' children. Here, it doesn't matter too much, since we're waiting for a specific child. However, if we were to use waitpid(-1, ...), it would be essential to use this flag. Still, even here, it's good to have this on. --- src/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index 732ca50..f800ad4 100644 --- a/src/process.c +++ b/src/process.c @@ -34,7 +34,7 @@ static int wait_for_child(pid_t pid, int *ec) { int status; - pid_t ret = waitpid(pid, &status, 0); + pid_t ret = waitpid(pid, &status, __WNOTHREAD); if (ret < 0) { log_errno("waitpid"); return ret; -- cgit v1.2.3