diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-03-04 10:25:09 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2024-03-04 10:25:09 +0200 |
commit | 067701f57758f9baed5bd9d868539738d77bfa92 (patch) | |
tree | b0f0a10a82b70792862d1f55357055f2211b32db /src/backend/postmaster/auxprocess.c | |
parent | a0cd95448067273a5cf92ad578a1e2de3b62aa2f (diff) |
Remove MyAuxProcType, use MyBackendType instead
MyAuxProcType was redundant with MyBackendType.
Reviewed-by: Reid Thompson, Andres Freund
Discussion: https://www.postgresql.org/message-id/f3ecd4cb-85ee-4e54-8278-5fabfb3a4ed0@iki.fi
Diffstat (limited to 'src/backend/postmaster/auxprocess.c')
-rw-r--r-- | src/backend/postmaster/auxprocess.c | 58 |
1 files changed, 11 insertions, 47 deletions
diff --git a/src/backend/postmaster/auxprocess.c b/src/backend/postmaster/auxprocess.c index 39171fea06b..fc13cd76321 100644 --- a/src/backend/postmaster/auxprocess.c +++ b/src/backend/postmaster/auxprocess.c @@ -38,14 +38,6 @@ static void ShutdownAuxiliaryProcess(int code, Datum arg); -/* ---------------- - * global variables - * ---------------- - */ - -AuxProcType MyAuxProcType = NotAnAuxProcess; /* declared in miscadmin.h */ - - /* * AuxiliaryProcessMain * @@ -55,39 +47,11 @@ AuxProcType MyAuxProcType = NotAnAuxProcess; /* declared in miscadmin.h */ * This code is here just because of historical reasons. */ void -AuxiliaryProcessMain(AuxProcType auxtype) +AuxiliaryProcessMain(BackendType auxtype) { Assert(IsUnderPostmaster); - MyAuxProcType = auxtype; - - switch (MyAuxProcType) - { - case StartupProcess: - MyBackendType = B_STARTUP; - break; - case ArchiverProcess: - MyBackendType = B_ARCHIVER; - break; - case BgWriterProcess: - MyBackendType = B_BG_WRITER; - break; - case CheckpointerProcess: - MyBackendType = B_CHECKPOINTER; - break; - case WalWriterProcess: - MyBackendType = B_WAL_WRITER; - break; - case WalReceiverProcess: - MyBackendType = B_WAL_RECEIVER; - break; - case WalSummarizerProcess: - MyBackendType = B_WAL_SUMMARIZER; - break; - default: - elog(PANIC, "unrecognized process type: %d", (int) MyAuxProcType); - MyBackendType = B_INVALID; - } + MyBackendType = auxtype; init_ps_display(NULL); @@ -126,38 +90,38 @@ AuxiliaryProcessMain(AuxProcType auxtype) SetProcessingMode(NormalProcessing); - switch (MyAuxProcType) + switch (MyBackendType) { - case StartupProcess: + case B_STARTUP: StartupProcessMain(); proc_exit(1); - case ArchiverProcess: + case B_ARCHIVER: PgArchiverMain(); proc_exit(1); - case BgWriterProcess: + case B_BG_WRITER: BackgroundWriterMain(); proc_exit(1); - case CheckpointerProcess: + case B_CHECKPOINTER: CheckpointerMain(); proc_exit(1); - case WalWriterProcess: + case B_WAL_WRITER: WalWriterMain(); proc_exit(1); - case WalReceiverProcess: + case B_WAL_RECEIVER: WalReceiverMain(); proc_exit(1); - case WalSummarizerProcess: + case B_WAL_SUMMARIZER: WalSummarizerMain(); proc_exit(1); default: - elog(PANIC, "unrecognized process type: %d", (int) MyAuxProcType); + elog(PANIC, "unrecognized process type: %d", (int) MyBackendType); proc_exit(1); } } |