mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
As part of the work for making relocatable installs, I have re-factored
all the code that looks for other binaries. I move FindExec into port/exec.c (and renamed it to find_my_binary()). I also added find_other_binary that looks for another binary in the same directory as the calling program, and checks the version string. The only behavior change was that initdb and pg_dump would look in the hard-coded bindir directory if it can't find the requested binary in the same directory as the caller. The new code throws an error. The old behavior seemed too error prone for version mismatches.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.382 2004/05/06 19:23:25 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.383 2004/05/11 21:57:14 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -692,7 +692,7 @@ PostmasterMain(int argc, char *argv[])
|
||||
/*
|
||||
* On some systems our dynloader code needs the executable's pathname.
|
||||
*/
|
||||
if (FindExec(pg_pathname, progname, "postgres") < 0)
|
||||
if (find_my_binary(pg_pathname, progname, "postgres") < 0)
|
||||
ereport(FATAL,
|
||||
(errmsg("%s: could not locate postgres executable",
|
||||
progname)));
|
||||
@@ -3222,7 +3222,7 @@ CreateOptsFile(int argc, char *argv[])
|
||||
FILE *fp;
|
||||
int i;
|
||||
|
||||
if (FindExec(fullprogname, argv[0], "postmaster") < 0)
|
||||
if (find_my_binary(fullprogname, argv[0], "postmaster") < 0)
|
||||
{
|
||||
elog(LOG, "could not locate postmaster");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user