From: weiyu Date: Fri, 2 Aug 2019 06:11:13 +0000 (-0700) Subject: move code around X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b62660007a8c6f837d732bfdf87576a345495827;p=c11tester.git move code around --- 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); - } } } }