summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/function.c')
-rw-r--r--contrib/pg_upgrade/function.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c
index 267f29143db..322503946ea 100644
--- a/contrib/pg_upgrade/function.c
+++ b/contrib/pg_upgrade/function.c
@@ -218,8 +218,7 @@ check_loadable_libraries(void)
prep_status("Checking for presence of required libraries");
- snprintf(output_path, sizeof(output_path), "%s/loadable_libraries.txt",
- os_info.cwd);
+ snprintf(output_path, sizeof(output_path), "loadable_libraries.txt");
for (libnum = 0; libnum < os_info.num_libraries; libnum++)
{
@@ -257,7 +256,7 @@ check_loadable_libraries(void)
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
found = true;
- if (script == NULL && (script = fopen(output_path, "w")) == NULL)
+ if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
pg_log(PG_FATAL, "Could not open file \"%s\": %s\n",
output_path, getErrorText(errno));
fprintf(script, "Could not load library \"%s\"\n%s\n",