aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/linux_common.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-03-05 12:59:12 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-03-05 12:59:12 +0100
commitbbd5104f064535a3da6bb3c21b826d645620db19 (patch)
tree79972483eae94ac05f69f9fea31e80d19d3ee126 /pkg/csource/linux_common.go
parent4bad0610063d1558db1ff2c41cb0be6a96539d08 (diff)
executor: fix includes
We use errno, vaargs, printf in all of fail/error/exitf, but we include the corresponding headers only when SYZ_USE_TMP_DIR. Include them whenever fail/error/exitf are used.
Diffstat (limited to 'pkg/csource/linux_common.go')
-rw-r--r--pkg/csource/linux_common.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go
index ee92f9fe5..a042b5a19 100644
--- a/pkg/csource/linux_common.go
+++ b/pkg/csource/linux_common.go
@@ -139,10 +139,15 @@ __attribute__((noreturn)) static void doexit(int status)
#include <stdint.h>
#include <string.h>
-#if defined(SYZ_EXECUTOR) || defined(SYZ_USE_TMP_DIR)
+#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT)) || \
+ defined(SYZ_USE_TMP_DIR) || defined(SYZ_TUN_ENABLE) || defined(SYZ_SANDBOX_NAMESPACE) || \
+ defined(SYZ_SANDBOX_NONE) || defined(SYZ_SANDBOX_SETUID) || defined(SYZ_FAULT_INJECTION) || \
+ defined(__NR_syz_kvm_setup_cpu) || defined(__NR_syz_init_net_socket)
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
+#endif
+#if defined(SYZ_EXECUTOR) || defined(SYZ_USE_TMP_DIR)
#include <stdlib.h>
#include <sys/stat.h>
#endif