@@ -126,7 +126,7 @@ static void dir_list_file_internal(parray *files, const char *root,
126126bool omit_symlink ,parray * black_list ,fio_location location );
127127
128128static void list_data_directories (parray * files ,const char * path ,bool is_root ,
129- bool exclude );
129+ bool exclude , fio_location location );
130130
131131/* Tablespace mapping */
132132static TablespaceList tablespace_dirs = {NULL ,NULL };
@@ -773,15 +773,15 @@ dir_list_file_internal(parray *files, const char *root, pgFile *parent,
773773 */
774774static void
775775list_data_directories (parray * files ,const char * path ,bool is_root ,
776- bool exclude )
776+ bool exclude , fio_location location )
777777{
778778DIR * dir ;
779779struct dirent * dent ;
780780int prev_errno ;
781781bool has_child_dirs = false;
782782
783783/* open directory and list contents */
784- dir = fio_opendir (path ,FIO_DB_HOST );
784+ dir = fio_opendir (path ,location );
785785if (dir == NULL )
786786elog (ERROR ,"cannot open directory \"%s\": %s" ,path ,strerror (errno ));
787787
@@ -799,7 +799,7 @@ list_data_directories(parray *files, const char *path, bool is_root,
799799
800800join_path_components (child ,path ,dent -> d_name );
801801
802- if (fio_stat (child ,& st , false,FIO_DB_HOST )== -1 )
802+ if (fio_stat (child ,& st , false,location )== -1 )
803803elog (ERROR ,"cannot stat file \"%s\": %s" ,child ,strerror (errno ));
804804
805805if (!S_ISDIR (st .st_mode ))
@@ -823,15 +823,15 @@ list_data_directories(parray *files, const char *path, bool is_root,
823823continue ;
824824
825825has_child_dirs = true;
826- list_data_directories (files ,child , false,exclude );
826+ list_data_directories (files ,child , false,exclude , location );
827827}
828828
829829/* List only full and last directories */
830830if (!is_root && !has_child_dirs )
831831{
832832pgFile * dir ;
833833
834- dir = pgFileNew (path , false,FIO_LOCAL_HOST );
834+ dir = pgFileNew (path , false,location );
835835parray_append (files ,dir );
836836}
837837
@@ -982,7 +982,8 @@ create_data_directories(const char *data_dir, const char *backup_dir,
982982}
983983
984984join_path_components (backup_database_dir ,backup_dir ,DATABASE_DIR );
985- list_data_directories (dirs ,backup_database_dir , true, false);
985+ list_data_directories (dirs ,backup_database_dir , true, false,
986+ FIO_BACKUP_HOST );
986987
987988elog (LOG ,"restore directories and symlinks..." );
988989