diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-05 12:49:08 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-05 13:05:47 +0200 |
| commit | 1beb81367ce08594953fd11d686589b9613c3a97 (patch) | |
| tree | 8e46b22cb2d6fd0c5a42271ba0d9f9fff90082ec /pkg/csource/generated.go | |
| parent | 2b5d3da50f7bb244d57ca18ba9fbfd20dc8b6706 (diff) | |
executor: check write return value
gcc complains:
error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
Also fix includes.
Diffstat (limited to 'pkg/csource/generated.go')
| -rw-r--r-- | pkg/csource/generated.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 8f1584596..6960a1f94 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -102,7 +102,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); @@ -3326,9 +3330,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) { @@ -3357,7 +3363,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); |
