We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b337aef commit 92cebaaCopy full SHA for 92cebaa
Python/sysmodule.c
@@ -2509,16 +2509,16 @@ PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void) {
2509
2510
PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename) {
2511
#ifndef MS_WINDOWS
2512
- FILE* from = fopen(parent_filename, "r");
2513
- if (!from) {
2514
- return -1;
2515
- }
2516
if (perf_map_state.perf_map == NULL) {
2517
int ret = PyUnstable_PerfMapState_Init();
2518
if (ret != 0) {
2519
return ret;
2520
}
2521
+ FILE* from = fopen(parent_filename, "r");
+ if (!from) {
+ return -1;
+ }
2522
char buf[4096];
2523
PyThread_acquire_lock(perf_map_state.map_lock, 1);
2524
int fflush_result = 0, result = 0;
0 commit comments