mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 19:38:09 +00:00
migrated autoresume to use get_afl_env
This commit is contained in:
@ -315,6 +315,7 @@ extern u8 skip_deterministic, /* Skip deterministic stages? */
|
||||
no_forkserver, /* Disable forkserver? */
|
||||
crash_mode, /* Crash mode! Yeah! */
|
||||
in_place_resume, /* Attempt in-place resume? */
|
||||
autoresume, /* Resume if out_dir exists? */
|
||||
auto_changed, /* Auto-generated tokens changed? */
|
||||
no_cpu_meter_red, /* Feng shui on the status screen */
|
||||
no_arith, /* Skip most arithmetic ops */
|
||||
|
@ -115,6 +115,7 @@ u8 skip_deterministic, /* Skip deterministic stages? */
|
||||
no_forkserver, /* Disable forkserver? */
|
||||
crash_mode, /* Crash mode! Yeah! */
|
||||
in_place_resume, /* Attempt in-place resume? */
|
||||
autoresume, /* Resume if out_dir exists? */
|
||||
auto_changed, /* Auto-generated tokens changed? */
|
||||
no_cpu_meter_red, /* Feng shui on the status screen */
|
||||
no_arith, /* Skip most arithmetic ops */
|
||||
|
@ -1066,7 +1066,7 @@ static void handle_existing_out_dir(void) {
|
||||
|
||||
/* Autoresume treats a normal run as in_place_resume if a valid out dir already exists */
|
||||
|
||||
if (getenv("AFL_AUTORESUME")) {
|
||||
if (!in_place_resume && autoresume) {
|
||||
|
||||
OKF("Detected prior run with AFL_AUTORESUME set. Resuming.");
|
||||
in_place_resume = 1;
|
||||
|
@ -314,14 +314,7 @@ int main(int argc, char** argv, char** envp) {
|
||||
if (in_dir) FATAL("Multiple -i options not supported");
|
||||
in_dir = optarg;
|
||||
|
||||
if (!strcmp(in_dir, "-")) {
|
||||
|
||||
if (getenv("AFL_AUTORESUME"))
|
||||
WARNF("AFL_AUTORESUME has no effect for '-i -'");
|
||||
|
||||
in_place_resume = 1;
|
||||
|
||||
}
|
||||
if (!strcmp(in_dir, "-")) in_place_resume = 1;
|
||||
|
||||
break;
|
||||
|
||||
@ -757,6 +750,14 @@ int main(int argc, char** argv, char** envp) {
|
||||
if (get_afl_env("AFL_SHUFFLE_QUEUE")) shuffle_queue = 1;
|
||||
if (get_afl_env("AFL_FAST_CAL")) fast_cal = 1;
|
||||
|
||||
if (get_afl_env("AFL_AUTORESUME")) {
|
||||
|
||||
autoresume = 1;
|
||||
if (in_place_resume)
|
||||
WARNF("AFL_AUTORESUME has no effect for '-i -'");
|
||||
|
||||
}
|
||||
|
||||
if (get_afl_env("AFL_HANG_TMOUT")) {
|
||||
|
||||
hang_tmout = atoi(getenv("AFL_HANG_TMOUT"));
|
||||
|
Reference in New Issue
Block a user