1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-01 00:25:06 +02:00

Remove pgPath parameter from pgControlFromFile().

In practice this function is always used with storagePg*() so pgPath is known.
This commit is contained in:
David Steele
2019-10-03 11:14:22 -04:00
parent 887ec97e07
commit 5394893e33
8 changed files with 13 additions and 17 deletions

View File

@ -417,15 +417,13 @@ pgControlFromBuffer(const Buffer *controlFile)
Get info from pg_control
***********************************************************************************************************************************/
PgControl
pgControlFromFile(const Storage *storage, const String *pgPath)
pgControlFromFile(const Storage *storage)
{
FUNCTION_LOG_BEGIN(logLevelDebug);
FUNCTION_LOG_PARAM(STORAGE, storage);
FUNCTION_LOG_PARAM(STRING, pgPath);
FUNCTION_LOG_END();
ASSERT(storage != NULL);
ASSERT(pgPath != NULL);
PgControl result = {0};
@ -433,8 +431,7 @@ pgControlFromFile(const Storage *storage, const String *pgPath)
{
// Read control file
Buffer *controlFile = storageGetP(
storageNewReadNP(storage, strNewFmt("%s/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, strPtr(pgPath))),
.exactSize = PG_CONTROL_DATA_SIZE);
storageNewReadNP(storage, STRDEF(PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL)), .exactSize = PG_CONTROL_DATA_SIZE);
result = pgControlFromBuffer(controlFile);
}