From b62660007a8c6f837d732bfdf87576a345495827 Mon Sep 17 00:00:00 2001 From: weiyu Date: Thu, 1 Aug 2019 23:11:13 -0700 Subject: [PATCH] move code around --- model.cc | 5 +++++ snapshot.cc | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model.cc b/model.cc index 66af9888..f3a7b6a7 100644 --- a/model.cc +++ b/model.cc @@ -475,4 +475,9 @@ void ModelChecker::run() /* Have the trace analyses dump their output. */ for (unsigned int i = 0;i < trace_analyses.size();i++) trace_analyses[i]->finish(); + + /* unlink tmp file created by last child process */ + char filename[256]; + snprintf_(filename, sizeof(filename), "C11FuzzerTmp%d", getpid()); + unlink(filename); } diff --git a/snapshot.cc b/snapshot.cc index d287319a..24e8d073 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -402,13 +402,8 @@ static void fork_loop() { } } - if (fork_snap->mIDToRollback != snapshotid) { - char filename[256]; - snprintf_(filename, sizeof(filename), "C11FuzzerTmp%d", forkedID); - unlink(filename); - + if (fork_snap->mIDToRollback != snapshotid) _Exit(EXIT_SUCCESS); - } } } } -- 2.34.1