mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
The problem is that read_pg_options needs DataDir to read its file but
DataDir is set after read_pg_options if postgres is called interactively. If postgres is forked by postgres DataDir is read from the PGDATA enviromnent variable set by the postmaster and this explains while the bug disappears. I have written this patch but I don't like it. Any better idea? Massimo Dal Zotto
This commit is contained in:
@@ -339,6 +339,11 @@ read_pg_options(SIGNAL_ARGS)
|
||||
char *s,
|
||||
*p;
|
||||
|
||||
if (!DataDir) {
|
||||
fprintf(stderr, "read_pg_options: DataDir not defined\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf(buffer, "%s/%s", DataDir, "pg_options");
|
||||
if ((fd = open(buffer, O_RDONLY)) < 0)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user