aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index f07ed76881f..87e60621396 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -183,7 +183,7 @@ static Backend *ShmemBackendArray;
* List of background workers.
*
* A worker that requests a database connection during registration will have
- * rw_backend set, and will be present in BackendList. Note: do not rely on
+ * rw_backend set, and will be present in BackendList. Note: do not rely on
* rw_backend being non-NULL for shmem-connected workers!
*/
typedef struct RegisteredBgWorker
@@ -197,7 +197,7 @@ typedef struct RegisteredBgWorker
int rw_cookie;
#endif
slist_node rw_lnode; /* list link */
-} RegisteredBgWorker;
+} RegisteredBgWorker;
static slist_head BackgroundWorkerList = SLIST_STATIC_INIT(BackgroundWorkerList);
@@ -207,8 +207,10 @@ BackgroundWorker *MyBgworkerEntry = NULL;
/* The socket number we are listening for connections on */
int PostPortNumber;
+
/* The directory names for Unix socket(s) */
char *Unix_socket_directories;
+
/* The TCP listen address(es) */
char *ListenAddresses;
@@ -446,7 +448,7 @@ typedef struct
HANDLE procHandle;
DWORD procId;
} win32_deadchild_waitinfo;
-#endif /* WIN32 */
+#endif /* WIN32 */
static pid_t backend_forkexec(Port *port);
static pid_t internal_forkexec(int argc, char *argv[], Port *port);
@@ -1022,7 +1024,7 @@ PostmasterMain(int argc, char *argv[])
/* syntax error in list */
ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("invalid list syntax for \"unix_socket_directories\"")));
+ errmsg("invalid list syntax for \"unix_socket_directories\"")));
}
foreach(l, elemlist)
@@ -1212,8 +1214,8 @@ PostmasterMain(int argc, char *argv[])
/*
* We can start up without the IDENT file, although it means that you
* cannot log in using any of the authentication methods that need a
- * user name mapping. load_ident() already logged the details of
- * error to the log.
+ * user name mapping. load_ident() already logged the details of error
+ * to the log.
*/
}
@@ -1414,7 +1416,7 @@ checkDataDir(void)
* we don't actually sleep so that they are quickly serviced.
*/
static void
-DetermineSleepTime(struct timeval *timeout)
+DetermineSleepTime(struct timeval * timeout)
{
TimestampTz next_wakeup = 0;
@@ -2969,7 +2971,7 @@ HandleChildCrash(int pid, int exitstatus, const char *procname)
rw = slist_container(RegisteredBgWorker, rw_lnode, siter.cur);
if (rw->rw_pid == 0)
- continue; /* not running */
+ continue; /* not running */
if (rw->rw_pid == pid)
{
/*
@@ -3819,9 +3821,9 @@ BackendInitialize(Port *port)
remote_host[0] = '\0';
remote_port[0] = '\0';
if ((ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- remote_host, sizeof(remote_host),
- remote_port, sizeof(remote_port),
- (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)
+ remote_host, sizeof(remote_host),
+ remote_port, sizeof(remote_port),
+ (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)
ereport(WARNING,
(errmsg_internal("pg_getnameinfo_all() failed: %s",
gai_strerror(ret))));
@@ -4503,7 +4505,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
- AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
+ AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavlauncher") == 0)
{
@@ -4519,7 +4521,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
- AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
+ AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavworker") == 0)
{
@@ -4535,7 +4537,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
- AutoVacWorkerMain(argc - 2, argv + 2); /* does not return */
+ AutoVacWorkerMain(argc - 2, argv + 2); /* does not return */
}
if (strncmp(argv[1], "--forkbgworker=", 15) == 0)
{
@@ -4564,7 +4566,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
- PgArchiverMain(argc, argv); /* does not return */
+ PgArchiverMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forkcol") == 0)
{
@@ -4573,7 +4575,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
- PgstatCollectorMain(argc, argv); /* does not return */
+ PgstatCollectorMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forklog") == 0)
{
@@ -4582,7 +4584,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
- SysLoggerMain(argc, argv); /* does not return */
+ SysLoggerMain(argc, argv); /* does not return */
}
abort(); /* shouldn't get here */
@@ -5214,11 +5216,11 @@ RegisterBackgroundWorker(BackgroundWorker *worker)
}
/*
- * Enforce maximum number of workers. Note this is overly restrictive:
- * we could allow more non-shmem-connected workers, because these don't
- * count towards the MAX_BACKENDS limit elsewhere. This doesn't really
- * matter for practical purposes; several million processes would need to
- * run on a single server.
+ * Enforce maximum number of workers. Note this is overly restrictive: we
+ * could allow more non-shmem-connected workers, because these don't count
+ * towards the MAX_BACKENDS limit elsewhere. This doesn't really matter
+ * for practical purposes; several million processes would need to run on
+ * a single server.
*/
if (++numworkers > maxworkers)
{
@@ -6156,7 +6158,7 @@ ShmemBackendArrayRemove(Backend *bn)
#ifdef WIN32
/*
- * Subset implementation of waitpid() for Windows. We assume pid is -1
+ * Subset implementation of waitpid() for Windows. We assume pid is -1
* (that is, check all child processes) and options is WNOHANG (don't wait).
*/
static pid_t