|
62 | 62 |
|
63 | 63 | externboolbootstrap_data_checksums; |
64 | 64 |
|
65 | | -charrecoveryConfPath[MAXPGPATH]; |
66 | 65 | /* File path names (all relative to $PGDATA) */ |
67 | 66 | #defineRECOVERY_COMMAND_FILE"recovery.conf" |
68 | 67 | #defineRECOVERY_COMMAND_DONE"recovery.done" |
@@ -4164,16 +4163,15 @@ readRecoveryCommandFile(void) |
4164 | 4163 | *head=NULL, |
4165 | 4164 | *tail=NULL; |
4166 | 4165 |
|
4167 | | -snprintf(recoveryConfPath,MAXPGPATH,"%s/%s",RecoveryConfDir,RECOVERY_COMMAND_FILE); |
4168 | | -fd=AllocateFile(recoveryConfPath,"r"); |
| 4166 | +fd=AllocateFile(RECOVERY_COMMAND_FILE,"r"); |
4169 | 4167 | if (fd==NULL) |
4170 | 4168 | { |
4171 | 4169 | if (errno==ENOENT) |
4172 | 4170 | return;/* not there, so no archive recovery */ |
4173 | 4171 | ereport(FATAL, |
4174 | 4172 | (errcode_for_file_access(), |
4175 | 4173 | errmsg("could not open recovery command file \"%s\": %m", |
4176 | | -recoveryConfPath))); |
| 4174 | +RECOVERY_COMMAND_FILE))); |
4177 | 4175 | } |
4178 | 4176 |
|
4179 | 4177 | /* |
@@ -4347,15 +4345,15 @@ readRecoveryCommandFile(void) |
4347 | 4345 | if (PrimaryConnInfo==NULL&&recoveryRestoreCommand==NULL) |
4348 | 4346 | ereport(WARNING, |
4349 | 4347 | (errmsg("recovery command file \"%s\" specified neither primary_conninfo nor restore_command", |
4350 | | -recoveryConfPath), |
| 4348 | +RECOVERY_COMMAND_FILE), |
4351 | 4349 | errhint("The database server will regularly poll the pg_xlog subdirectory to check for files placed there."))); |
4352 | 4350 | } |
4353 | 4351 | else |
4354 | 4352 | { |
4355 | 4353 | if (recoveryRestoreCommand==NULL) |
4356 | 4354 | ereport(FATAL, |
4357 | 4355 | (errmsg("recovery command file \"%s\" must specify restore_command when standby mode is not enabled", |
4358 | | -recoveryConfPath))); |
| 4356 | +RECOVERY_COMMAND_FILE))); |
4359 | 4357 | } |
4360 | 4358 |
|
4361 | 4359 | /* Enable fetching from archive recovery area */ |
@@ -4397,7 +4395,6 @@ static void |
4397 | 4395 | exitArchiveRecovery(TimeLineIDendTLI,XLogSegNoendLogSegNo) |
4398 | 4396 | { |
4399 | 4397 | charrecoveryPath[MAXPGPATH]; |
4400 | | -charrecoveryDonePath[MAXPGPATH]; |
4401 | 4398 | charxlogpath[MAXPGPATH]; |
4402 | 4399 |
|
4403 | 4400 | /* |
@@ -4462,13 +4459,12 @@ exitArchiveRecovery(TimeLineID endTLI, XLogSegNo endLogSegNo) |
4462 | 4459 | * Rename the config file out of the way, so that we don't accidentally |
4463 | 4460 | * re-enter archive recovery mode in a subsequent crash. |
4464 | 4461 | */ |
4465 | | -snprintf(recoveryDonePath,MAXPGPATH,"%s/%s",RecoveryConfDir,RECOVERY_COMMAND_DONE); |
4466 | | -unlink(recoveryDonePath); |
4467 | | -if (rename(recoveryConfPath,recoveryDonePath)!=0) |
| 4462 | +unlink(RECOVERY_COMMAND_DONE); |
| 4463 | +if (rename(RECOVERY_COMMAND_FILE,RECOVERY_COMMAND_DONE)!=0) |
4468 | 4464 | ereport(FATAL, |
4469 | 4465 | (errcode_for_file_access(), |
4470 | 4466 | errmsg("could not rename file \"%s\" to \"%s\": %m", |
4471 | | -recoveryConfPath,recoveryDonePath))); |
| 4467 | +RECOVERY_COMMAND_FILE,RECOVERY_COMMAND_DONE))); |
4472 | 4468 |
|
4473 | 4469 | ereport(LOG, |
4474 | 4470 | (errmsg("archive recovery complete"))); |
|