move code around
authorweiyu <weiyuluo1232@gmail.com>
Fri, 2 Aug 2019 06:11:13 +0000 (23:11 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Fri, 2 Aug 2019 06:11:13 +0000 (23:11 -0700)
model.cc
snapshot.cc

index 66af988821af8ef491191a0cfb80151092ef38fd..f3a7b6a77bad087a2dd0ff15e138cbcf8f32d79a 100644 (file)
--- 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);
 }
index d287319a5f0bda5f18438b2e8354e60ab755e4da..24e8d073ca1330eb778b897955e500dab30f9c5e 100644 (file)
@@ -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);
-                       }
                }
        }
 }