diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2017-05-18 18:17:16 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@google.com> | 2017-06-12 19:48:23 +0200 |
| commit | c99b02d2248fbdcd6f44037326b16c928f4423f1 (patch) | |
| tree | 5e60a5df686a1160d6c88e40bc05223805a13749 /executor | |
| parent | 73a895df6168bc12559d1fa16aae7e52646d7ec3 (diff) | |
csource: try to simplify repeat loop
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common.h | 13 |
1 files changed, 10 insertions, 3 deletions
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 |
