aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
Diffstat (limited to 'executor')
-rw-r--r--executor/common.h6
-rw-r--r--executor/common_linux.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/executor/common.h b/executor/common.h
index 6ba88ea3b..7255b7dc7 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -117,7 +117,11 @@ static void install_segv_handler()
#endif
#if !GOOS_linux
-#if SYZ_EXECUTOR || SYZ_REPEAT && SYZ_EXECUTOR_USES_FORK_SERVER
+#if (SYZ_EXECUTOR || SYZ_REPEAT) && SYZ_EXECUTOR_USES_FORK_SERVER
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
static void kill_and_wait(int pid, int* status)
{
kill(pid, SIGKILL);
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 610586021..7f6b799cf 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -1863,9 +1863,11 @@ static int fault_injected(int fail_fd)
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#include <signal.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/wait.h>
static void kill_and_wait(int pid, int* status)
{
@@ -1900,7 +1902,9 @@ static void kill_and_wait(int pid, int* status)
continue;
}
debug("aborting fuse conn %s\n", ent->d_name);
- write(fd, abort, 1);
+ if (write(fd, abort, 1) < 0) {
+ debug("failed to abort: %d\n", errno);
+ }
close(fd);
}
closedir(dir);