@@ -1480,7 +1480,7 @@ update_recovery_options_before_v12(pgBackup *backup,
1480
1480
}
1481
1481
1482
1482
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" );
1484
1484
1485
1485
fp = fio_fopen (path , "w" , FIO_DB_HOST );
1486
1486
if (fp == NULL )
@@ -1537,8 +1537,7 @@ update_recovery_options(pgBackup *backup,
1537
1537
1538
1538
time2iso (current_time_str , lengthof (current_time_str ), current_time , false);
1539
1539
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" );
1542
1541
1543
1542
if (fio_stat (postgres_auto_path , & st , false, FIO_DB_HOST ) < 0 )
1544
1543
{
@@ -1648,7 +1647,7 @@ update_recovery_options(pgBackup *backup,
1648
1647
if (params -> recovery_settings_mode == PITR_REQUESTED )
1649
1648
{
1650
1649
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" );
1652
1651
1653
1652
fp = fio_fopen (path , PG_BINARY_W , FIO_DB_HOST );
1654
1653
if (fp == NULL )
@@ -1664,7 +1663,7 @@ update_recovery_options(pgBackup *backup,
1664
1663
if (params -> restore_as_replica )
1665
1664
{
1666
1665
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" );
1668
1667
1669
1668
fp = fio_fopen (path , PG_BINARY_W , FIO_DB_HOST );
1670
1669
if (fp == NULL )
@@ -2160,7 +2159,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
2160
2159
{
2161
2160
char pid_file [MAXPGPATH ];
2162
2161
2163
- snprintf (pid_file , MAXPGPATH , "%s/ postmaster.pid" , pgdata );
2162
+ join_path_components (pid_file , pgdata , "postmaster.pid" );
2164
2163
elog (WARNING , "Pid file \"%s\" is mangled, cannot determine whether postmaster is running or not" ,
2165
2164
pid_file );
2166
2165
success = false;
@@ -2201,7 +2200,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
2201
2200
*/
2202
2201
if (incremental_mode == INCR_LSN )
2203
2202
{
2204
- snprintf (backup_label , MAXPGPATH , "%s/ backup_label" , pgdata );
2203
+ join_path_components (backup_label , pgdata , "backup_label" );
2205
2204
if (fio_access (backup_label , F_OK , FIO_DB_HOST ) == 0 )
2206
2205
{
2207
2206
elog (WARNING , "Destination directory contains \"backup_control\" file. "
0 commit comments