Skip to content

Commit 5a7e1a1

Browse files
committed
Move find_my_exec lower so elog() works, per Tom.
1 parent ecc198b commit 5a7e1a1

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/backend/main/main.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*
1515
* IDENTIFICATION
16-
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.79 2004/05/18 20:27:24 momjian Exp $
16+
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.80 2004/05/19 18:58:44 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -241,16 +241,6 @@ main(int argc, char *argv[])
241241
#endif /* !WIN32 */
242242
}
243243

244-
if (find_my_exec(argv[0], my_exec_path) < 0)
245-
{
246-
fprintf(stderr,
247-
gettext("%s: could not locate my own executable path"),
248-
argv[0]);
249-
exit(1);
250-
}
251-
252-
get_pkglib_path(my_exec_path, pkglib_path);
253-
254244
/*
255245
* Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain,
256246
* SubPostmasterMain, pgstat_main, pgstat_mainChild or BootstrapMain

src/backend/postmaster/postmaster.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.390 2004/05/18 20:27:25 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.391 2004/05/19 18:58:44 momjian Exp $
4141
*
4242
* NOTES
4343
*
@@ -461,6 +461,11 @@ PostmasterMain(int argc, char *argv[])
461461

462462
IgnoreSystemIndexes(false);
463463

464+
if (find_my_exec(argv[0], my_exec_path) < 0)
465+
elog(FATAL,
466+
gettext("%s: could not locate my own executable path"),
467+
argv[0]);
468+
464469
/*
465470
* Options setup
466471
*/

src/backend/tcop/postgres.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.409 2004/05/18 20:27:25 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.410 2004/05/19 18:58:44 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -2185,6 +2185,13 @@ PostgresMain(int argc, char *argv[], const char *username)
21852185
/* Set up reference point for stack depth checking */
21862186
stack_base_ptr = &stack_base;
21872187

2188+
if (find_my_exec(argv[0], my_exec_path) < 0)
2189+
elog(FATAL,
2190+
gettext("%s: could not locate my own executable path"),
2191+
argv[0]);
2192+
2193+
get_pkglib_path(my_exec_path, pkglib_path);
2194+
21882195
/*
21892196
* Set default values for command-line options.
21902197
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy