diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-03-05 12:59:12 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-03-05 12:59:12 +0100 |
| commit | bbd5104f064535a3da6bb3c21b826d645620db19 (patch) | |
| tree | 79972483eae94ac05f69f9fea31e80d19d3ee126 /pkg | |
| parent | 4bad0610063d1558db1ff2c41cb0be6a96539d08 (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')
| -rw-r--r-- | pkg/csource/akaros_common.go | 7 | ||||
| -rw-r--r-- | pkg/csource/freebsd_common.go | 7 | ||||
| -rw-r--r-- | pkg/csource/linux_common.go | 7 | ||||
| -rw-r--r-- | pkg/csource/netbsd_common.go | 7 |
4 files changed, 24 insertions, 4 deletions
diff --git a/pkg/csource/akaros_common.go b/pkg/csource/akaros_common.go index c0984ed99..f86d175d1 100644 --- a/pkg/csource/akaros_common.go +++ b/pkg/csource/akaros_common.go @@ -47,10 +47,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 diff --git a/pkg/csource/freebsd_common.go b/pkg/csource/freebsd_common.go index 1e6597bbc..e5dc7376b 100644 --- a/pkg/csource/freebsd_common.go +++ b/pkg/csource/freebsd_common.go @@ -38,10 +38,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 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 diff --git a/pkg/csource/netbsd_common.go b/pkg/csource/netbsd_common.go index 3714f29da..7f22f3b53 100644 --- a/pkg/csource/netbsd_common.go +++ b/pkg/csource/netbsd_common.go @@ -38,10 +38,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 |
