File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2509,10 +2509,6 @@ PyAPI_FUNC(void) PyUnstable_PerfMapState_Fini(void) {
2509
2509
2510
2510
PyAPI_FUNC (int ) PyUnstable_CopyPerfMapFile (const char * parent_filename ) {
2511
2511
#ifndef MS_WINDOWS
2512
- FILE * from = fopen (parent_filename , "r" );
2513
- if (!from ) {
2514
- return -1 ;
2515
- }
2516
2512
if (perf_map_state .perf_map == NULL ) {
2517
2513
int ret = PyUnstable_PerfMapState_Init ();
2518
2514
if (ret != 0 ) {
@@ -2521,6 +2517,10 @@ PyAPI_FUNC(int) PyUnstable_CopyPerfMapFile(const char* parent_filename) {
2521
2517
}
2522
2518
char buf [4096 ];
2523
2519
PyThread_acquire_lock (perf_map_state .map_lock , 1 );
2520
+ FILE * from = fopen (parent_filename , "r" );
2521
+ if (!from ) {
2522
+ return -1 ;
2523
+ }
2524
2524
int fflush_result = 0 , result = 0 ;
2525
2525
while (1 ) {
2526
2526
size_t bytes_read = fread (buf , 1 , sizeof (buf ), from );
You can’t perform that action at this time.
0 commit comments