mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-14 11:08:06 +00:00
refactored global lists
This commit is contained in:
@ -71,7 +71,7 @@ static void init_mopt_globals(afl_state_t *afl) {
|
||||
/* A global pointer to all instances is needed (for now) for signals to arrive
|
||||
*/
|
||||
|
||||
list_t afl_states = {.element_prealloc_count = 0};
|
||||
static list_t afl_states = {.element_prealloc_count = 0};
|
||||
|
||||
/* Initializes an afl_state_t. */
|
||||
|
||||
@ -398,3 +398,34 @@ void afl_state_deinit(afl_state_t *afl) {
|
||||
|
||||
}
|
||||
|
||||
void afl_states_stop(void) {
|
||||
|
||||
/* We may be inside a signal handler.
|
||||
Set flags first, send kill signals to child proceses later. */
|
||||
LIST_FOREACH(&afl_states, afl_state_t, {
|
||||
|
||||
el->stop_soon = 1;
|
||||
|
||||
});
|
||||
|
||||
LIST_FOREACH(&afl_states, afl_state_t, {
|
||||
|
||||
if (el->fsrv.child_pid > 0) kill(el->fsrv.child_pid, SIGKILL);
|
||||
if (el->fsrv.fsrv_pid > 0) kill(el->fsrv.fsrv_pid, SIGKILL);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void afl_states_clear_screen(void) {
|
||||
|
||||
LIST_FOREACH(&afl_states, afl_state_t, { el->clear_screen = 1; });
|
||||
|
||||
}
|
||||
|
||||
void afl_states_request_skip(void) {
|
||||
|
||||
LIST_FOREACH(&afl_states, afl_state_t, { el->skip_requested = 1; });
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user