From c99b02d2248fbdcd6f44037326b16c928f4423f1 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 18 May 2017 18:17:16 +0200 Subject: csource: try to simplify repeat loop --- executor/common.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'executor') diff --git a/executor/common.h b/executor/common.h index 4ee1cd140..6e4955fab 100644 --- a/executor/common.h +++ b/executor/common.h @@ -827,7 +827,7 @@ static int do_sandbox_namespace(int executor_pid, bool enable_tun) } #endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT) +#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_WAIT_REPEAT)) // One does not simply remove a directory. // There can be mounts, so we need to try to umount. // Moreover, a mount can be mounted several times, so we need to try to umount in a loop. @@ -904,9 +904,7 @@ retry: exitf("rmdir(%s) failed", dir); } } -#endif -#if defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT) static uint64_t current_time_ms() { struct timespec ts; @@ -937,6 +935,7 @@ static int inject_fault(int nth) #if defined(SYZ_REPEAT) static void test(); +#if defined(SYZ_WAIT_REPEAT) void loop() { int iter; @@ -977,4 +976,12 @@ void loop() remove_dir(cwdbuf); } } +#else +void loop() +{ + while (1) { + test(); + } +} +#endif #endif -- cgit mrf-deployment