diff options
Diffstat (limited to 'src/backend/utils/init/miscinit.c')
-rw-r--r-- | src/backend/utils/init/miscinit.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 24ca97d55c7..3d48eb8c9d3 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -100,6 +100,25 @@ SetDataDir(const char *dir) } /* + * Set recovery config directory, but make sure it's an absolute path. Use this, + * never set RecoveryConfDir directly. + */ +void +SetRecoveryConfDir(const char *dir) +{ + char *new; + + AssertArg(dir); + + /* If presented path is relative, convert to absolute */ + new = make_absolute_path(dir); + + if (RecoveryConfDir) + free(RecoveryConfDir); + RecoveryConfDir = new; +} + +/* * Change working directory to DataDir. Most of the postmaster and backend * code assumes that we are in DataDir so it can use relative paths to access * stuff in and under the data directory. For convenience during path |