summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2019-02-09 05:49:27 +0100
committerRobert Swiecki <robert@swiecki.net>2019-02-09 05:49:27 +0100
commitc46089c0d34a2535cc3a6e62b050380c2e723894 (patch)
tree1c81a7115b984c691c3c72e28288d6f223206e6d
parent0f51c8cf4d41b25e712af683e456e93d96cdac13 (diff)
parent19f285da054ff0848b64fe6512da78589b01eed5 (diff)
downloadhonggfuzz-c46089c0d34a2535cc3a6e62b050380c2e723894.tar.gz
Merge branch 'master' of ssh://github.com/google/honggfuzz
-rw-r--r--hfuzz_cc/hfuzz-cc.c10
-rw-r--r--mac/arch.c4
-rw-r--r--subproc.c4
3 files changed, 10 insertions, 8 deletions
diff --git a/hfuzz_cc/hfuzz-cc.c b/hfuzz_cc/hfuzz-cc.c
index 363d5ccc..2c45f0e3 100644
--- a/hfuzz_cc/hfuzz-cc.c
+++ b/hfuzz_cc/hfuzz-cc.c
@@ -399,14 +399,14 @@ static int ldMode(int argc, char** argv) {
args[j++] = getLibHFNetDriverPath();
/* Pull modules defining the following symbols (if they exist) */
-#ifndef _HF_ARCH_DARWIN
+#ifdef _HF_ARCH_DARWIN
+ args[j++] = "-Wl,-U,_LIBHFNETDRIVER_module_main",
+ args[j++] = "-Wl,-U,_LIBHFUZZ_module_instrument";
+ args[j++] = "-Wl,-U,_LIBHFUZZ_module_memorycmp";
+#else /* _HF_ARCH_DARWIN */
args[j++] = "-Wl,-u,LIBHFNETDRIVER_module_main",
args[j++] = "-Wl,-u,LIBHFUZZ_module_instrument";
args[j++] = "-Wl,-u,LIBHFUZZ_module_memorycmp";
-#else /* _HF_ARCH_DARWIN */
- args[j++] = "-Wl,-u,_LIBHFNETDRIVER_module_main",
- args[j++] = "-Wl,-u,_LIBHFUZZ_module_instrument";
- args[j++] = "-Wl,-u,_LIBHFUZZ_module_memorycmp";
#endif /* _HF_ARCH_DARWIN */
/* Needed by the libhfcommon */
diff --git a/mac/arch.c b/mac/arch.c
index 41f18d21..4878c4ee 100644
--- a/mac/arch.c
+++ b/mac/arch.c
@@ -391,6 +391,7 @@ void arch_reapChild(run_t* run) {
}
if (ret == -1 && errno == EINTR) {
subproc_checkTimeLimit(run);
+ subproc_checkTermination(run);
continue;
}
if (ret == -1) {
@@ -402,8 +403,7 @@ void arch_reapChild(run_t* run) {
}
char strStatus[4096];
- if (run->global->exe.persistent && ret == run->persistentPid &&
- (WIFEXITED(status) || WIFSIGNALED(status))) {
+ if (run->global->exe.persistent && (WIFEXITED(status) || WIFSIGNALED(status))) {
if (!fuzz_isTerminating()) {
LOG_W("Persistent mode: PID %d exited with status: %s", ret,
subproc_StatusToStr(status, strStatus, sizeof(strStatus)));
diff --git a/subproc.c b/subproc.c
index a8daf964..bd905335 100644
--- a/subproc.c
+++ b/subproc.c
@@ -177,7 +177,9 @@ bool subproc_persistentModeStateMachine(run_t* run) {
/* The current persistent round is done */
return true;
}; break;
- default: { LOG_F("Unknown runState: %d", run->runState); }; break;
+ default: {
+ LOG_F("Unknown runState: %d", run->runState);
+ }; break;
}
}
}