summaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2019-02-14 23:02:13 +0100
committerRobert Swiecki <robert@swiecki.net>2019-02-14 23:02:13 +0100
commit64d52436fd74340d09c0a6615894f4791baffb15 (patch)
tree87aa8018d873695f00188f61dda6a441ef4e7a4d /mac
parent0c52f7defe6668f7ccc7ff2033cbf9bb90cc8182 (diff)
downloadhonggfuzz-64d52436fd74340d09c0a6615894f4791baffb15.tar.gz
create a signal thread to distribute SIGCHLD as SIGUSR1
Diffstat (limited to 'mac')
-rw-r--r--mac/arch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mac/arch.c b/mac/arch.c
index 43e0b8ae..23869a16 100644
--- a/mac/arch.c
+++ b/mac/arch.c
@@ -382,11 +382,16 @@ void arch_reapChild(run_t* run) {
if (r == -1 && errno != EINTR) {
PLOG_F("poll(fd=%d)", run->persistentSock);
}
+ } else {
+ /* Return with SIGIO, SIGCHLD and with SIGUSR1 */
+ int sig = sigwaitinfo(&run->global->exe.waitSigSet, NULL);
+ if (sig == -1 && (errno != EAGAIN && errno != EINTR)) {
+ PLOG_F("sigwaitinfo(SIGIO|SIGCHLD|SIGUSR1)");
+ }
}
int status;
- int flags = run->global->exe.persistent ? WNOHANG : 0;
- int ret = waitpid(run->pid, &status, flags);
+ int ret = waitpid(run->pid, &status, WNOHANG);
if (ret == 0) {
continue;
}