diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-04-10 17:47:22 +0200 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-04-10 17:47:22 +0200 |
commit | f0f83bab5299098a441af40236f3758171b69889 (patch) | |
tree | 8dabf0609ced7101c467d945bb173be9b180105b /src/afl-common.c | |
parent | 6aa6af04acb8f024696e8723e6d73514006b3dd5 (diff) | |
download | afl++-f0f83bab5299098a441af40236f3758171b69889.tar.gz |
resize fix + code format
Diffstat (limited to 'src/afl-common.c')
-rw-r--r-- | src/afl-common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/afl-common.c b/src/afl-common.c index 7eee5265..12b0355e 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -40,6 +40,7 @@ u8 be_quiet = 0; u8 *doc_path = ""; +u8 last_intr = 0; char *afl_environment_variables[] = { @@ -754,7 +755,8 @@ u8 *u_stringify_time_diff(u8 *buf, u64 cur_ms, u64 event_ms) { Returns the time passed to read. If the wait times out, returns timeout_ms + 1; Returns 0 if an error occurred (fd closed, signal, ...); */ -u32 read_timed(s32 fd, void *buf, size_t len, u32 timeout_ms) { +u32 read_timed(s32 fd, void *buf, size_t len, u32 timeout_ms, + volatile u8 *stop_soon_p) { struct timeval timeout; fd_set readfds; @@ -779,8 +781,8 @@ u32 read_timed(s32 fd, void *buf, size_t len, u32 timeout_ms) { } else if (sret < 0) { - // perror("sret malloc"); - // TODO: catch other (errno == EINTR) than ctrl+c? + /* Retry select for all signals other than than ctrl+c */ + if (errno == EINTR && !*stop_soon_p) { continue; } return 0; } |