From 030fe91346fc1e6bd916cf043e30f4a60c5b55e0 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sun, 1 Aug 2021 14:39:25 -0700
Subject: [PATCH v1 06/10] process startup: Rename StartChildProcess to
 StartAuxiliaryProcess.

The prior name was confusing because postmaster.c has many types of children,
but StartChildProcess was only used for aux processes. Even more confusing,
there's SignalChildren/SignalSomeChildren(), which do *not* target aux
processes.

Author:
Reviewed-By:
Discussion: https://postgr.es/m/
Backpatch:
---
 src/backend/postmaster/postmaster.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 46c6d76ccf9..65bc4dcbbd6 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -433,7 +433,7 @@ static int	CountChildren(int target);
 static bool assign_backendlist_entry(RegisteredBgWorker *rw);
 static void maybe_start_bgworkers(void);
 static bool CreateOptsFile(int argc, char *argv[], char *fullprogname);
-static pid_t StartChildProcess(AuxProcType type);
+static pid_t StartAuxiliaryProcess(AuxProcType type);
 static void StartAutovacuumWorker(void);
 static void MaybeStartWalReceiver(void);
 static void InitPostmasterDeathWatchHandle(void);
@@ -551,12 +551,12 @@ static void ShmemBackendArrayAdd(Backend *bn);
 static void ShmemBackendArrayRemove(Backend *bn);
 #endif							/* EXEC_BACKEND */
 
-#define StartupDataBase()		StartChildProcess(StartupProcess)
-#define StartArchiver()			StartChildProcess(ArchiverProcess)
-#define StartBackgroundWriter() StartChildProcess(BgWriterProcess)
-#define StartCheckpointer()		StartChildProcess(CheckpointerProcess)
-#define StartWalWriter()		StartChildProcess(WalWriterProcess)
-#define StartWalReceiver()		StartChildProcess(WalReceiverProcess)
+#define StartupDataBase()		StartAuxiliaryProcess(StartupProcess)
+#define StartArchiver()			StartAuxiliaryProcess(ArchiverProcess)
+#define StartBackgroundWriter() StartAuxiliaryProcess(BgWriterProcess)
+#define StartCheckpointer()		StartAuxiliaryProcess(CheckpointerProcess)
+#define StartWalWriter()		StartAuxiliaryProcess(WalWriterProcess)
+#define StartWalReceiver()		StartAuxiliaryProcess(WalReceiverProcess)
 
 /* Macros to check exit status of a child process */
 #define EXIT_STATUS_0(st)  ((st) == 0)
@@ -5401,16 +5401,16 @@ CountChildren(int target)
 
 
 /*
- * StartChildProcess -- start an auxiliary process for the postmaster
+ * StartAuxiliaryProcess -- start an auxiliary process for the postmaster
  *
  * "type" determines what kind of child will be started.  All child types
  * initially go to AuxiliaryProcessMain, which will handle common setup.
  *
- * Return value of StartChildProcess is subprocess' PID, or 0 if failed
+ * Return value of StartAuxiliaryProcess is subprocess' PID, or 0 if failed
  * to start subprocess.
  */
 static pid_t
-StartChildProcess(AuxProcType type)
+StartAuxiliaryProcess(AuxProcType type)
 {
 	pid_t		pid;
 
-- 
2.32.0.rc2

