File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
contrib/pg_tde/src/access Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -702,7 +702,6 @@ pg_tde_write_map_keydata_file(off_t file_size, char *file_data)
702
702
char path_new [MAXPGPATH ];
703
703
int fd_new ;
704
704
off_t curr_pos = 0 ;
705
- bool is_err = false;
706
705
707
706
/* Let's get the header. Buff should start with the map file header. */
708
707
fheader = (TDEFileHeader * ) file_data ;
@@ -717,23 +716,22 @@ pg_tde_write_map_keydata_file(off_t file_size, char *file_data)
717
716
ereport (WARNING ,
718
717
errcode_for_file_access (),
719
718
errmsg ("could not write tde file \"%s\": %m" , path_new ));
720
- is_err = true ;
721
- goto FINALIZE ;
719
+ close ( fd_new ) ;
720
+ return ;
722
721
}
722
+
723
723
if (pg_fsync (fd_new ) != 0 )
724
724
{
725
725
ereport (WARNING ,
726
726
errcode_for_file_access (),
727
727
errmsg ("could not fsync file \"%s\": %m" , path_new ));
728
- is_err = true ;
729
- goto FINALIZE ;
728
+ close ( fd_new ) ;
729
+ return ;
730
730
}
731
731
732
- FINALIZE :
733
732
close (fd_new );
734
733
735
- if (!is_err )
736
- finalize_key_rotation (db_map_path , path_new );
734
+ finalize_key_rotation (db_map_path , path_new );
737
735
}
738
736
739
737
/* It's called by seg_write inside crit section so no pallocs, hence
You can’t perform that action at this time.
0 commit comments