about summary refs log tree commit diff
path: root/src/afl-gotcpu.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-22 13:51:40 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-04-22 13:51:40 +0200
commitdf8a0e84184a408a463c29443cfa3ee9fa556896 (patch)
tree0257c84abe8b4f9859caf2f35244adc7146ee994 /src/afl-gotcpu.c
parentb8a25063f678c8afe3c1390d6a6ba130b0500e26 (diff)
parent6df21f3489ea482362983eda7e51c040d06e56f1 (diff)
downloadafl++-df8a0e84184a408a463c29443cfa3ee9fa556896.tar.gz
Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev
Diffstat (limited to 'src/afl-gotcpu.c')
-rw-r--r--src/afl-gotcpu.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/afl-gotcpu.c b/src/afl-gotcpu.c
index 6c2fa147..ab7aad5c 100644
--- a/src/afl-gotcpu.c
+++ b/src/afl-gotcpu.c
@@ -102,8 +102,12 @@ repeat_loop:
 
   v1 = CTEST_BUSY_CYCLES;
 
-  while (v1--)
+  while (v1--) {
+
     v2++;
+
+  }
+
   sched_yield();
 
   en_t = get_cur_time_us();
@@ -154,7 +158,7 @@ int main(int argc, char **argv) {
 
     s32 fr = fork();
 
-    if (fr < 0) PFATAL("fork failed");
+    if (fr < 0) { PFATAL("fork failed"); }
 
     if (!fr) {
 
@@ -192,8 +196,12 @@ int main(int argc, char **argv) {
 #endif
 
 #if defined(__linux__)
-      if (sched_setaffinity(0, sizeof(c), &c))
+      if (sched_setaffinity(0, sizeof(c), &c)) {
+
         PFATAL("sched_setaffinity failed for cpu %d", i);
+
+      }
+
 #endif
 
       util_perc = measure_preemption(CTEST_CORE_TRG_MS);
@@ -221,10 +229,10 @@ int main(int argc, char **argv) {
   for (i = 0; i < cpu_cnt; i++) {
 
     int ret;
-    if (waitpid(-1, &ret, 0) < 0) PFATAL("waitpid failed");
+    if (waitpid(-1, &ret, 0) < 0) { PFATAL("waitpid failed"); }
 
-    if (WEXITSTATUS(ret) == 0) idle_cpus++;
-    if (WEXITSTATUS(ret) <= 1) maybe_cpus++;
+    if (WEXITSTATUS(ret) == 0) { idle_cpus++; }
+    if (WEXITSTATUS(ret) <= 1) { maybe_cpus++; }
 
   }