File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88#include < string>
99#include < system_error>
1010
11+ #ifdef _WIN32
12+ #include < process.h>
13+ #else
14+ #include < unistd.h>
15+ #endif
16+
1117#include " ../src/TIFlashFile.h"
1218#include " ../src/TIModels.h"
1319#include " ../src/TIVarFile.h"
@@ -27,6 +33,15 @@ namespace
2733 std::once_flag initFlag;
2834 std::atomic<uint64_t > inputCounter{0 };
2935
36+ int current_process_id ()
37+ {
38+ #ifdef _WIN32
39+ return _getpid ();
40+ #else
41+ return getpid ();
42+ #endif
43+ }
44+
3045 void init_library ()
3146 {
3247 std::call_once (initFlag, []()
@@ -48,7 +63,7 @@ namespace
4863 }
4964
5065 const uint64_t uniqueId = inputCounter.fetch_add (1 , std::memory_order_relaxed);
51- const std::filesystem::path path = tempDir / (" tivars-fuzz-" + std::to_string (uniqueId) + " .bin" );
66+ const std::filesystem::path path = tempDir / (" tivars-fuzz-" + std::to_string (current_process_id ()) + " - " + std::to_string ( uniqueId) + " .bin" );
5267 std::ofstream out (path, std::ios::binary);
5368 out.write (reinterpret_cast <const char *>(data), static_cast <std::streamsize>(size));
5469 out.close ();
You can’t perform that action at this time.
0 commit comments