aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/common.go2
-rw-r--r--pkg/csource/csource.go4
2 files changed, 2 insertions, 4 deletions
diff --git a/pkg/csource/common.go b/pkg/csource/common.go
index 90b1943fc..a2fcd6897 100644
--- a/pkg/csource/common.go
+++ b/pkg/csource/common.go
@@ -14,8 +14,6 @@ var commonHeader = `
#include <unistd.h>
#if defined(SYZ_EXECUTOR) || defined(SYZ_THREADED) || defined(SYZ_COLLIDE)
#include <pthread.h>
-#endif
-#if defined(SYZ_EXECUTOR) || defined(SYZ_COLLIDE)
#include <stdlib.h>
#endif
#if defined(SYZ_EXECUTOR) || defined(SYZ_HANDLE_SEGV)
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index e52be3e88..32415e982 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -219,7 +219,7 @@ func generateTestFunc(w io.Writer, opts Options, calls []string, name string) {
}
fmt.Fprintf(w, "\tfor (i = 0; i < %v; i++) {\n", len(calls))
fmt.Fprintf(w, "\t\tpthread_create(&th[i], 0, thr, (void*)i);\n")
- fmt.Fprintf(w, "\t\tusleep(10000);\n")
+ fmt.Fprintf(w, "\t\tusleep(rand()%%10000);\n")
fmt.Fprintf(w, "\t}\n")
if opts.Collide {
fmt.Fprintf(w, "\tfor (i = 0; i < %v; i++) {\n", len(calls))
@@ -228,7 +228,7 @@ func generateTestFunc(w io.Writer, opts Options, calls []string, name string) {
fmt.Fprintf(w, "\t\t\tusleep(rand()%%10000);\n")
fmt.Fprintf(w, "\t}\n")
}
- fmt.Fprintf(w, "\tusleep(100000);\n")
+ fmt.Fprintf(w, "\tusleep(rand()%%100000);\n")
fmt.Fprintf(w, "}\n\n")
}
}