Revert "Replace gettimeofday with clock_gettime (#2159)"

This reverts commit 7c380a6612.
This commit is contained in:
vanhauser-thc
2024-07-14 10:18:23 +02:00
parent 7c380a6612
commit ccb952dde8
8 changed files with 51 additions and 50 deletions

View File

@ -555,7 +555,8 @@ int main(int argc, char **argv_orig, char **envp) {
char *frida_afl_preload = NULL;
char **use_argv;
struct timespec spec;
struct timeval tv;
struct timezone tz;
doc_path = access(DOC_PATH, F_OK) != 0 ? (u8 *)"docs" : (u8 *)DOC_PATH;
@ -602,8 +603,8 @@ int main(int argc, char **argv_orig, char **envp) {
SAYF(cCYA "afl-fuzz" VERSION cRST
" based on afl by Michal Zalewski and a large online community\n");
clock_gettime(CLOCK_REALTIME, &spec);
rand_set_seed(afl, spec.tv_sec ^ spec.tv_nsec ^ getpid());
gettimeofday(&tv, &tz);
rand_set_seed(afl, tv.tv_sec ^ tv.tv_usec ^ getpid());
afl->shmem_testcase_mode = 1; // we always try to perform shmem fuzzing