@@ -844,15 +844,15 @@ opt_externaldir_map(ConfigOption *opt, const char *arg)
844
844
*/
845
845
void
846
846
create_data_directories (parray * dest_files , const char * data_dir , const char * backup_dir ,
847
- bool extract_tablespaces , bool incremental , fio_location location ,
847
+ bool extract_tablespaces , bool incremental , pioDrive_i location ,
848
848
const char * waldir_path )
849
849
{
850
850
int i ;
851
851
parray * links = NULL ;
852
852
mode_t pg_tablespace_mode = DIR_PERMISSION ;
853
853
char to_path [MAXPGPATH ];
854
854
855
- if (waldir_path && !dir_is_empty ( waldir_path , location ))
855
+ if (waldir_path && !$i ( pioIsDirEmpty , location , waldir_path ))
856
856
{
857
857
elog (ERROR , "WAL directory location is not empty: \"%s\"" , waldir_path );
858
858
}
@@ -932,12 +932,25 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
932
932
waldir_path , to_path );
933
933
934
934
/* create tablespace directory from waldir_path*/
935
- fio_mkdir (location , waldir_path , pg_tablespace_mode , false);
935
+ {
936
+ int rc ;
937
+ rc = $i (pioMakeDir , location , .path = waldir_path ,
938
+ .mode = pg_tablespace_mode , .strict = false);
939
+ if (rc ) {
940
+ elog (WARNING , "Can not create wal directory \"%s\": \"%s\"" ,
941
+ waldir_path , strerror (errno ));
942
+ }
943
+ }
936
944
937
945
/* create link to linked_path */
938
- if (fio_symlink (location , waldir_path , to_path , incremental ) < 0 )
939
- elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
940
- to_path , strerror (errno ));
946
+ {
947
+ int rc ;
948
+ rc = $i (pioSymLink ,location , waldir_path , to_path , incremental );
949
+ if (rc < 0 ) {
950
+ elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
951
+ to_path , strerror (errno ));
952
+ }
953
+ }
941
954
942
955
continue ;
943
956
@@ -974,12 +987,26 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
974
987
linked_path , to_path );
975
988
976
989
/* create tablespace directory */
977
- fio_mkdir (location , linked_path , pg_tablespace_mode , false);
990
+ {
991
+ int rc ;
992
+
993
+ rc = $i (pioMakeDir , location , .path = linked_path ,
994
+ .mode = pg_tablespace_mode , .strict = false);
995
+ if (rc ) {
996
+ elog (WARNING , "Can not create tablespace directory \"%s\": \"%s\"" ,
997
+ linked_path , strerror (errno ));
998
+ }
999
+ }
978
1000
979
1001
/* create link to linked_path */
980
- if (fio_symlink (location , linked_path , to_path , incremental ) < 0 )
981
- elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
982
- to_path , strerror (errno ));
1002
+ {
1003
+ int rc ;
1004
+
1005
+ rc = $i (pioSymLink , location , linked_path , to_path , incremental );
1006
+ if (rc < 0 )
1007
+ elog (ERROR , "Could not create symbolic link \"%s\": %s" ,
1008
+ to_path , strerror (errno ));
1009
+ }
983
1010
984
1011
continue ;
985
1012
}
@@ -992,7 +1019,14 @@ create_data_directories(parray *dest_files, const char *data_dir, const char *ba
992
1019
join_path_components (to_path , data_dir , dir -> rel_path );
993
1020
994
1021
// TODO check exit code
995
- fio_mkdir (location , to_path , dir -> mode , false);
1022
+ {
1023
+ int rc ;
1024
+
1025
+ rc = $i (pioMakeDir , location , .path = to_path , .mode = dir -> mode , .strict = false);
1026
+ if (rc ) {
1027
+ elog (WARNING , "Can not create directory \"%s\": \"%s\"" , to_path , strerror (errno ));
1028
+ }
1029
+ }
996
1030
}
997
1031
998
1032
if (extract_tablespaces )
0 commit comments