aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-30 01:15:48 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-30 01:15:52 +0200
commit9e279f212f2c35d1972a5fe4e9ebd09e37d20d15 (patch)
tree2c76a6801edaf0978f7859f8f431b4fd67f1d680 /src
parenttest: split tests into different files (diff)
downloadcimple-9e279f212f2c35d1972a5fe4e9ebd09e37d20d15.tar.gz
cimple-9e279f212f2c35d1972a5fe4e9ebd09e37d20d15.zip
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.
Diffstat (limited to '')
-rw-r--r--src/process.c2
1 files changed, 1 insertions, 1 deletions
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;