@@ -37,8 +37,7 @@ catalog_lock(void)
3737int ret ;
3838char id_path [MAXPGPATH ];
3939
40- snprintf (id_path ,lengthof (id_path ),"%s/%s" ,backup_path ,
41- PG_RMAN_INI_FILE );
40+ join_path_components (id_path ,backup_path ,PG_RMAN_INI_FILE );
4241lock_fd = open (id_path ,O_RDWR );
4342if (lock_fd == -1 )
4443elog (errno == ENOENT ?ERROR_CORRUPTED :ERROR_SYSTEM ,
@@ -81,8 +80,8 @@ catalog_unlock(void)
8180pgBackup *
8281catalog_get_backup (time_t timestamp )
8382{
84- pgBackup tmp ;
85- char ini_path [MAXPGPATH ];
83+ pgBackup tmp ;
84+ char ini_path [MAXPGPATH ];
8685
8786tmp .start_time = timestamp ;
8887pgBackupGetPath (& tmp ,ini_path ,lengthof (ini_path ),BACKUP_INI_FILE );
@@ -120,18 +119,18 @@ parray *
120119catalog_get_backup_list (const pgBackupRange * range )
121120{
122121const pgBackupRange range_all = {0 ,0 };
123- DIR * date_dir = NULL ;
124- struct dirent * date_ent = NULL ;
125- DIR * time_dir = NULL ;
126- struct dirent * time_ent = NULL ;
127- char date_path [MAXPGPATH ];
128- parray * backups = NULL ;
129- pgBackup * backup = NULL ;
130- struct tm * tm ;
131- char begin_date [100 ];
132- char begin_time [100 ];
133- char end_date [100 ];
134- char end_time [100 ];
122+ DIR * date_dir = NULL ;
123+ struct dirent * date_ent = NULL ;
124+ DIR * time_dir = NULL ;
125+ struct dirent * time_ent = NULL ;
126+ char date_path [MAXPGPATH ];
127+ parray * backups = NULL ;
128+ pgBackup * backup = NULL ;
129+ struct tm * tm ;
130+ char begin_date [100 ];
131+ char begin_time [100 ];
132+ char end_date [100 ];
133+ char end_time [100 ];
135134
136135if (range == NULL )
137136range = & range_all ;
@@ -172,7 +171,7 @@ catalog_get_backup_list(const pgBackupRange *range)
172171continue ;
173172
174173/* open subdirectory (date directory) and search time directory */
175- snprintf (date_path , MAXPGPATH , "%s/%s" ,backup_path ,date_ent -> d_name );
174+ join_path_components (date_path ,backup_path ,date_ent -> d_name );
176175time_dir = opendir (date_path );
177176if (time_dir == NULL )
178177{
@@ -291,8 +290,8 @@ catalog_get_last_arclog_backup(parray *backup_list)
291290pgBackup *
292291catalog_get_last_srvlog_backup (parray * backup_list )
293292{
294- int i ;
295- pgBackup * backup = NULL ;
293+ int i ;
294+ pgBackup * backup = NULL ;
296295
297296/* backup_list is sorted in order of descending ID */
298297for (i = 0 ;i < parray_num (backup_list );i ++ )
@@ -311,9 +310,9 @@ catalog_get_last_srvlog_backup(parray *backup_list)
311310int
312311pgBackupCreateDir (pgBackup * backup )
313312{
314- int i ;
315- char path [MAXPGPATH ];
316- char * subdirs []= {DATABASE_DIR ,ARCLOG_DIR ,SRVLOG_DIR ,NULL };
313+ int i ;
314+ char path [MAXPGPATH ];
315+ char * subdirs []= {DATABASE_DIR ,ARCLOG_DIR ,SRVLOG_DIR ,NULL };
317316
318317pgBackupGetPath (backup ,path ,lengthof (path ),NULL );
319318dir_create_dir (path ,DIR_PERMISSION );
@@ -377,8 +376,8 @@ pgBackupWriteResultSection(FILE *out, pgBackup *backup)
377376void
378377pgBackupWriteIni (pgBackup * backup )
379378{
380- FILE * fp = NULL ;
381- char ini_path [MAXPGPATH ];
379+ FILE * fp = NULL ;
380+ char ini_path [MAXPGPATH ];
382381
383382pgBackupGetPath (backup ,ini_path ,lengthof (ini_path ),BACKUP_INI_FILE );
384383fp = fopen (ini_path ,"wt" );
@@ -561,8 +560,8 @@ pgBackupCompareIdDesc(const void *l, const void *r)
561560void
562561pgBackupGetPath (const pgBackup * backup ,char * path ,size_t len ,const char * subdir )
563562{
564- char datetime [20 ];
565- struct tm * tm ;
563+ char datetime [20 ];
564+ struct tm * tm ;
566565
567566/* generate $BACKUP_PATH/date/time path */
568567tm = localtime (& backup -> start_time );