aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index b84955577..0fd7a1582 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -2612,12 +2612,20 @@ static void setup_test()
flush_tun();
#endif
}
+#endif
-#define SYZ_HAVE_RESET_TEST 1
-static void reset_test()
+#if SYZ_EXECUTOR || SYZ_ENABLE_CLOSE_FDS
+#define SYZ_HAVE_CLOSE_FDS 1
+static void close_fds()
{
+#if SYZ_EXECUTOR
+ if (!flag_enable_close_fds)
+ return;
+#endif
// Keeping a 9p transport pipe open will hang the proccess dead,
// so close all opened file descriptors.
+ // Also close all USB emulation descriptors to trigger exit from USB
+ // event loop to collect coverage.
int fd;
for (fd = 3; fd < 30; fd++)
close(fd);