diff options
| author | Bruce Momjian <bruce@momjian.us> | 2004-01-06 23:15:22 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2004-01-06 23:15:22 +0000 |
| commit | 488f2785d025a6cc04685cfee4ca3eac0086e2fd (patch) | |
| tree | b21e8ead6a04bef7a128d2b2307b2e68efba2ce9 /src/backend/main | |
| parent | 06288d4e2256ec2f458baa07f337cddd9c915b03 (diff) | |
| download | postgresql-488f2785d025a6cc04685cfee4ca3eac0086e2fd.tar.gz | |
Final rearrangement of main postgresql child process (ie.
BackendFork/SSDataBase/pgstat) startup, to allow fork/exec calls to
closely mimic (the soon to be provided) Win32 CreateProcess equivalent
calls.
Claudio Natoli
Diffstat (limited to 'src/backend/main')
| -rw-r--r-- | src/backend/main/main.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 84036314cd..b8dffc430a 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.69 2003/12/25 03:52:50 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.70 2004/01/06 23:15:22 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -203,9 +203,9 @@ main(int argc, char *argv[]) /* * Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain, - * pgstat_main, pgstat_mainChild or BootstrapMain depending on the - * program name (and possibly first argument) we were called with. - * The lack of consistency here is historical. + * SubPostmasterMain, pgstat_main, pgstat_mainChild or BootstrapMain + * depending on the program name (and possibly first argument) we + * were called with. The lack of consistency here is historical. */ len = strlen(new_argv[0]); @@ -224,6 +224,16 @@ main(int argc, char *argv[]) #ifdef EXEC_BACKEND /* + * If the first argument is "-forkexec", then invoke SubPostmasterMain. Note + * we remove "-forkexec" from the arguments passed on to SubPostmasterMain. + */ + if (argc > 1 && strcmp(new_argv[1], "-forkexec") == 0) + { + SubPostmasterMain(argc - 2, new_argv + 2); + exit(0); + } + + /* * If the first argument is "-statBuf", then invoke pgstat_main. Note * we remove "-statBuf" from the arguments passed on to pgstat_main. */ |
