summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorTom Lane2017-06-21 18:39:04 +0000
committerTom Lane2017-06-21 18:39:04 +0000
commite3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 (patch)
tree8dc7df95c340803546152724fbc17aee4b8527f9 /src/backend/postmaster
parent8ff6d4ec7840b0af56f1207073f44b7f2afae96d (diff)
Initial pgindent run with pg_bsd_indent version 2.0.
The new indent version includes numerous fixes thanks to Piotr Stefaniak. The main changes visible in this commit are: * Nicer formatting of function-pointer declarations. * No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof. * No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers. * Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely. * Fixes bug where comments following declarations were sometimes placed with no space separating them from the code. * Fixes some odd decisions for comments following case labels. * Fixes some cases where comments following code were indented to less than the expected column 33. On the less good side, it now tends to put more whitespace around typedef names that are not listed in typedefs.list. This might encourage us to put more effort into typedef name collection; it's not really a bug in indent itself. There are more changes coming after this round, having to do with comment indentation and alignment of lines appearing within parentheses. I wanted to limit the size of the diffs to something that could be reviewed without one's eyes completely glazing over, so it seemed better to split up the changes as much as practical. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/autovacuum.c6
-rw-r--r--src/backend/postmaster/bgworker.c2
-rw-r--r--src/backend/postmaster/pgstat.c14
-rw-r--r--src/backend/postmaster/postmaster.c23
-rw-r--r--src/backend/postmaster/syslogger.c2
5 files changed, 24 insertions, 23 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 89dd3b321bc..5baa6db321a 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -242,7 +242,7 @@ typedef enum
AutoVacForkFailed, /* failed trying to start a worker */
AutoVacRebalance, /* rebalance the cost limits */
AutoVacNumSignals /* must be last */
-} AutoVacuumSignal;
+} AutoVacuumSignal;
/*-------------
* The main autovacuum shmem struct. On shared memory we store this main
@@ -321,7 +321,7 @@ NON_EXEC_STATIC void AutoVacLauncherMain(int argc, char *argv[]) pg_attribute_no
static Oid do_start_worker(void);
static void launcher_determine_sleep(bool canlaunch, bool recursing,
- struct timeval * nap);
+ struct timeval *nap);
static void launch_worker(TimestampTz now);
static List *get_database_list(void);
static void rebuild_database_list(Oid newdb);
@@ -849,7 +849,7 @@ shutdown:
* cause a long sleep, which will be interrupted when a worker exits.
*/
static void
-launcher_determine_sleep(bool canlaunch, bool recursing, struct timeval * nap)
+launcher_determine_sleep(bool canlaunch, bool recursing, struct timeval *nap)
{
/*
* We sleep until the next scheduled vacuum. We trust that when the
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 712d700481d..09b7fb40920 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -118,7 +118,7 @@ static const struct
{
const char *fn_name;
bgworker_main_type fn_addr;
-} InternalBGWorkers[] =
+} InternalBGWorkers[] =
{
{
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index f453dade6c6..5cf95822463 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -443,7 +443,7 @@ pgstat_init(void)
}
alen = sizeof(pgStatAddr);
- if (getsockname(pgStatSock, (struct sockaddr *) & pgStatAddr, &alen) < 0)
+ if (getsockname(pgStatSock, (struct sockaddr *) &pgStatAddr, &alen) < 0)
{
ereport(LOG,
(errcode_for_socket_access(),
@@ -459,7 +459,7 @@ pgstat_init(void)
* provides a kernel-level check that only packets from this same
* address will be received.
*/
- if (connect(pgStatSock, (struct sockaddr *) & pgStatAddr, alen) < 0)
+ if (connect(pgStatSock, (struct sockaddr *) &pgStatAddr, alen) < 0)
{
ereport(LOG,
(errcode_for_socket_access(),
@@ -1107,7 +1107,7 @@ pgstat_vacuum_stat(void)
if (msg.m_nentries >= PGSTAT_NUM_TABPURGE)
{
len = offsetof(PgStat_MsgTabpurge, m_tableid[0])
- +msg.m_nentries * sizeof(Oid);
+ + msg.m_nentries * sizeof(Oid);
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE);
msg.m_databaseid = MyDatabaseId;
@@ -1123,7 +1123,7 @@ pgstat_vacuum_stat(void)
if (msg.m_nentries > 0)
{
len = offsetof(PgStat_MsgTabpurge, m_tableid[0])
- +msg.m_nentries * sizeof(Oid);
+ + msg.m_nentries * sizeof(Oid);
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE);
msg.m_databaseid = MyDatabaseId;
@@ -1167,7 +1167,7 @@ pgstat_vacuum_stat(void)
if (f_msg.m_nentries >= PGSTAT_NUM_FUNCPURGE)
{
len = offsetof(PgStat_MsgFuncpurge, m_functionid[0])
- +f_msg.m_nentries * sizeof(Oid);
+ + f_msg.m_nentries * sizeof(Oid);
pgstat_send(&f_msg, len);
@@ -1181,7 +1181,7 @@ pgstat_vacuum_stat(void)
if (f_msg.m_nentries > 0)
{
len = offsetof(PgStat_MsgFuncpurge, m_functionid[0])
- +f_msg.m_nentries * sizeof(Oid);
+ + f_msg.m_nentries * sizeof(Oid);
pgstat_send(&f_msg, len);
}
@@ -1284,7 +1284,7 @@ pgstat_drop_relation(Oid relid)
msg.m_tableid[0] = relid;
msg.m_nentries = 1;
- len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) +sizeof(Oid);
+ len = offsetof(PgStat_MsgTabpurge, m_tableid[0]) + sizeof(Oid);
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_TABPURGE);
msg.m_databaseid = MyDatabaseId;
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 5c79b1e40d1..a5d3575b209 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -340,6 +340,7 @@ static PMState pmState = PM_INIT;
/* Start time of SIGKILL timeout during immediate shutdown or child crash */
/* Zero means timeout is not running */
static time_t AbortStartTime = 0;
+
/* Length of said timeout */
#define SIGKILL_CHILDREN_AFTER_SECS 5
@@ -1558,7 +1559,7 @@ checkDataDir(void)
* cases are as shown in the code.
*/
static void
-DetermineSleepTime(struct timeval * timeout)
+DetermineSleepTime(struct timeval *timeout)
{
TimestampTz next_wakeup = 0;
@@ -3541,16 +3542,16 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
errhint("See C include file \"ntstatus.h\" for a description of the hexadecimal value."),
activity ? errdetail("Failed process was running: %s", activity) : 0));
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
- ereport(lev,
-
- /*------
- translator: %s is a noun phrase describing a child process, such as
- "server process" */
- (errmsg("%s (PID %d) was terminated by signal %d: %s",
- procname, pid, WTERMSIG(exitstatus),
- WTERMSIG(exitstatus) < NSIG ?
- sys_siglist[WTERMSIG(exitstatus)] : "(unknown)"),
- activity ? errdetail("Failed process was running: %s", activity) : 0));
+ ereport(lev,
+
+ /*------
+ translator: %s is a noun phrase describing a child process, such as
+ "server process" */
+ (errmsg("%s (PID %d) was terminated by signal %d: %s",
+ procname, pid, WTERMSIG(exitstatus),
+ WTERMSIG(exitstatus) < NSIG ?
+ sys_siglist[WTERMSIG(exitstatus)] : "(unknown)"),
+ activity ? errdetail("Failed process was running: %s", activity) : 0));
#else
ereport(lev,
diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c
index 9f5ca5cac08..9828999eb84 100644
--- a/src/backend/postmaster/syslogger.c
+++ b/src/backend/postmaster/syslogger.c
@@ -797,7 +797,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
int dest = LOG_DESTINATION_STDERR;
/* While we have enough for a header, process data... */
- while (count >= (int) (offsetof(PipeProtoHeader, data) +1))
+ while (count >= (int) (offsetof(PipeProtoHeader, data) + 1))
{
PipeProtoHeader p;
int chunklen;