@@ -1480,7 +1480,7 @@ update_recovery_options_before_v12(pgBackup *backup,
14801480 }
14811481
14821482 elog (LOG , "update recovery settings in recovery.conf" );
1483- snprintf (path , lengthof ( path ) , "%s/ recovery.conf" , instance_config . pgdata );
1483+ join_path_components (path , instance_config . pgdata , "recovery.conf" );
14841484
14851485 fp = fio_fopen (path , "w" , FIO_DB_HOST );
14861486 if (fp == NULL )
@@ -1537,8 +1537,7 @@ update_recovery_options(pgBackup *backup,
15371537
15381538 time2iso (current_time_str , lengthof (current_time_str ), current_time , false);
15391539
1540- snprintf (postgres_auto_path , lengthof (postgres_auto_path ),
1541- "%s/postgresql.auto.conf" , instance_config .pgdata );
1540+ join_path_components (postgres_auto_path , instance_config .pgdata , "postgresql.auto.conf" );
15421541
15431542 if (fio_stat (postgres_auto_path , & st , false, FIO_DB_HOST ) < 0 )
15441543 {
@@ -1648,7 +1647,7 @@ update_recovery_options(pgBackup *backup,
16481647 if (params -> recovery_settings_mode == PITR_REQUESTED )
16491648 {
16501649 elog (LOG , "creating recovery.signal file" );
1651- snprintf (path , lengthof ( path ) , "%s/ recovery.signal" , instance_config . pgdata );
1650+ join_path_components (path , instance_config . pgdata , "recovery.signal" );
16521651
16531652 fp = fio_fopen (path , PG_BINARY_W , FIO_DB_HOST );
16541653 if (fp == NULL )
@@ -1664,7 +1663,7 @@ update_recovery_options(pgBackup *backup,
16641663 if (params -> restore_as_replica )
16651664 {
16661665 elog (LOG , "creating standby.signal file" );
1667- snprintf (path , lengthof ( path ) , "%s/ standby.signal" , instance_config . pgdata );
1666+ join_path_components (path , instance_config . pgdata , "standby.signal" );
16681667
16691668 fp = fio_fopen (path , PG_BINARY_W , FIO_DB_HOST );
16701669 if (fp == NULL )
@@ -2160,7 +2159,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
21602159 {
21612160 char pid_file [MAXPGPATH ];
21622161
2163- snprintf (pid_file , MAXPGPATH , "%s/ postmaster.pid" , pgdata );
2162+ join_path_components (pid_file , pgdata , "postmaster.pid" );
21642163 elog (WARNING , "Pid file \"%s\" is mangled, cannot determine whether postmaster is running or not" ,
21652164 pid_file );
21662165 success = false;
@@ -2201,7 +2200,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
22012200 */
22022201 if (incremental_mode == INCR_LSN )
22032202 {
2204- snprintf (backup_label , MAXPGPATH , "%s/ backup_label" , pgdata );
2203+ join_path_components (backup_label , pgdata , "backup_label" );
22052204 if (fio_access (backup_label , F_OK , FIO_DB_HOST ) == 0 )
22062205 {
22072206 elog (WARNING , "Destination directory contains \"backup_control\" file. "
0 commit comments