@@ -955,7 +955,6 @@ copy_file(fio_location from_location, const char *to_root,
955955size_t read_len = 0 ;
956956int errno_tmp ;
957957char buf [BLCKSZ ];
958- struct stat st ;
959958pg_crc32 crc ;
960959
961960INIT_FILE_CRC32 (true,crc );
@@ -999,15 +998,6 @@ copy_file(fio_location from_location, const char *to_root,
999998to_path ,strerror (errno_tmp ));
1000999}
10011000
1002- /* stat source file to change mode of destination file */
1003- if (fio_ffstat (in ,& st )== -1 )
1004- {
1005- fio_fclose (in );
1006- fio_fclose (out );
1007- elog (ERROR ,"cannot stat \"%s\": %s" ,file -> path ,
1008- strerror (errno ));
1009- }
1010-
10111001/* copy content and calc CRC */
10121002for (;;)
10131003{
@@ -1064,7 +1054,7 @@ copy_file(fio_location from_location, const char *to_root,
10641054file -> crc = crc ;
10651055
10661056/* update file permission */
1067- if (fio_chmod (to_path ,st . st_mode ,to_location )== -1 )
1057+ if (fio_chmod (to_path ,file -> mode ,to_location )== -1 )
10681058{
10691059errno_tmp = errno ;
10701060fio_fclose (in );