summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorBruce Momjian2006-10-04 00:30:14 +0000
committerBruce Momjian2006-10-04 00:30:14 +0000
commitf99a569a2ee3763b4ae174e81250c95ca0fdcbb6 (patch)
tree76e6371fe8b347c73d7020c0bc54b9fba519dc10 /src/backend/postmaster
parent451e419e9852cdf9d7e7cefc09d5355abb3405e9 (diff)
pgindent run for 8.2.
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/autovacuum.c42
-rw-r--r--src/backend/postmaster/bgwriter.c30
-rw-r--r--src/backend/postmaster/pgstat.c126
-rw-r--r--src/backend/postmaster/postmaster.c67
4 files changed, 131 insertions, 134 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 25a19b2b24b..2ba12c2f9e6 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.26 2006/07/31 20:09:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.27 2006/10/04 00:29:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -269,10 +269,10 @@ AutoVacMain(int argc, char *argv[])
BaseInit();
/*
- * Create a per-backend PGPROC struct in shared memory, except in
- * the EXEC_BACKEND case where this was done in SubPostmasterMain.
- * We must do this before we can use LWLocks (and in the EXEC_BACKEND
- * case we already had to do some stuff with LWLocks).
+ * Create a per-backend PGPROC struct in shared memory, except in the
+ * EXEC_BACKEND case where this was done in SubPostmasterMain. We must do
+ * this before we can use LWLocks (and in the EXEC_BACKEND case we already
+ * had to do some stuff with LWLocks).
*/
#ifndef EXEC_BACKEND
InitProcess();
@@ -305,9 +305,9 @@ AutoVacMain(int argc, char *argv[])
PG_SETMASK(&UnBlockSig);
/*
- * Force zero_damaged_pages OFF in the autovac process, even if it is
- * set in postgresql.conf. We don't really want such a dangerous option
- * being applied non-interactively.
+ * Force zero_damaged_pages OFF in the autovac process, even if it is set
+ * in postgresql.conf. We don't really want such a dangerous option being
+ * applied non-interactively.
*/
SetConfigOption("zero_damaged_pages", "false", PGC_SUSET, PGC_S_OVERRIDE);
@@ -387,8 +387,8 @@ AutoVacMain(int argc, char *argv[])
}
/*
- * Otherwise, skip a database with no pgstat entry; it means it hasn't
- * seen any activity.
+ * Otherwise, skip a database with no pgstat entry; it means it
+ * hasn't seen any activity.
*/
tmp->entry = pgstat_fetch_stat_dbentry(tmp->oid);
if (!tmp->entry)
@@ -409,7 +409,7 @@ AutoVacMain(int argc, char *argv[])
* backend signalled the postmaster. Pick up the database with the
* greatest age, and apply a database-wide vacuum on it.
*/
- int32 oldest = 0;
+ int32 oldest = 0;
whole_db = true;
foreach(cell, dblist)
@@ -535,7 +535,7 @@ process_whole_db(void)
/* Start a transaction so our commands have one to play into. */
StartTransactionCommand();
- /* functions in indexes may want a snapshot set */
+ /* functions in indexes may want a snapshot set */
ActiveSnapshot = CopySnapshot(GetTransactionSnapshot());
/*
@@ -593,13 +593,13 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
/* Start a transaction so our commands have one to play into. */
StartTransactionCommand();
- /* functions in indexes may want a snapshot set */
+ /* functions in indexes may want a snapshot set */
ActiveSnapshot = CopySnapshot(GetTransactionSnapshot());
/*
- * Clean up any dead statistics collector entries for this DB.
- * We always want to do this exactly once per DB-processing cycle,
- * even if we find nothing worth vacuuming in the database.
+ * Clean up any dead statistics collector entries for this DB. We always
+ * want to do this exactly once per DB-processing cycle, even if we find
+ * nothing worth vacuuming in the database.
*/
pgstat_vacuum_tabstat();
@@ -948,7 +948,7 @@ autovacuum_do_vac_analyze(List *relids, bool dovacuum, bool doanalyze,
/*
* autovac_report_activity
- * Report to pgstat what autovacuum is doing
+ * Report to pgstat what autovacuum is doing
*
* We send a SQL string corresponding to what the user would see if the
* equivalent command was to be issued manually.
@@ -989,13 +989,13 @@ autovac_report_activity(VacuumStmt *vacstmt, List *relids)
char *nspname = get_namespace_name(get_rel_namespace(relid));
/*
- * Paranoia is appropriate here in case relation was recently
- * dropped --- the lsyscache routines we just invoked will return
- * NULL rather than failing.
+ * Paranoia is appropriate here in case relation was recently dropped
+ * --- the lsyscache routines we just invoked will return NULL rather
+ * than failing.
*/
if (relname && nspname)
{
- int len = strlen(activity);
+ int len = strlen(activity);
snprintf(activity + len, MAX_AUTOVAC_ACTIV_LEN - len,
" %s.%s", nspname, relname);
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 679b8a5c723..69a6734bc57 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.27 2006/08/17 23:04:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/bgwriter.c,v 1.28 2006/10/04 00:29:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -207,14 +207,13 @@ BackgroundWriterMain(void)
#endif
/*
- * Initialize so that first time-driven event happens at the correct
- * time.
+ * Initialize so that first time-driven event happens at the correct time.
*/
last_checkpoint_time = last_xlog_switch_time = time(NULL);
/*
- * Create a resource owner to keep track of our resources (currently
- * only buffer pins).
+ * Create a resource owner to keep track of our resources (currently only
+ * buffer pins).
*/
CurrentResourceOwner = ResourceOwnerCreate(NULL, "Background Writer");
@@ -406,17 +405,17 @@ BackgroundWriterMain(void)
BgBufferSync();
/*
- * Check for archive_timeout, if so, switch xlog files. First
- * we do a quick check using possibly-stale local state.
+ * Check for archive_timeout, if so, switch xlog files. First we do a
+ * quick check using possibly-stale local state.
*/
if (XLogArchiveTimeout > 0 &&
(int) (now - last_xlog_switch_time) >= XLogArchiveTimeout)
{
/*
- * Update local state ... note that last_xlog_switch_time is
- * the last time a switch was performed *or requested*.
+ * Update local state ... note that last_xlog_switch_time is the
+ * last time a switch was performed *or requested*.
*/
- time_t last_time = GetLastSegSwitchTime();
+ time_t last_time = GetLastSegSwitchTime();
last_xlog_switch_time = Max(last_xlog_switch_time, last_time);
@@ -427,7 +426,7 @@ BackgroundWriterMain(void)
/* Now we can do the real check */
if ((int) (now - last_xlog_switch_time) >= XLogArchiveTimeout)
{
- XLogRecPtr switchpoint;
+ XLogRecPtr switchpoint;
/* OK, it's time to switch */
switchpoint = RequestXLogSwitch();
@@ -440,9 +439,10 @@ BackgroundWriterMain(void)
ereport(DEBUG1,
(errmsg("xlog switch forced (archive_timeout=%d)",
XLogArchiveTimeout)));
+
/*
- * Update state in any case, so we don't retry constantly
- * when the system is idle.
+ * Update state in any case, so we don't retry constantly when
+ * the system is idle.
*/
last_xlog_switch_time = now;
}
@@ -463,9 +463,9 @@ BackgroundWriterMain(void)
(bgwriter_lru_percent > 0.0 && bgwriter_lru_maxpages > 0))
udelay = BgWriterDelay * 1000L;
else if (XLogArchiveTimeout > 0)
- udelay = 1000000L; /* One second */
+ udelay = 1000000L; /* One second */
else
- udelay = 10000000L; /* Ten seconds */
+ udelay = 10000000L; /* Ten seconds */
while (udelay > 999999L)
{
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 715de0071c1..db4a57b0171 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.138 2006/08/28 19:38:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.139 2006/10/04 00:29:56 momjian Exp $
* ----------
*/
#include "postgres.h"
@@ -136,8 +136,8 @@ static TransactionId pgStatLocalStatusXact = InvalidTransactionId;
static PgBackendStatus *localBackendStatusTable = NULL;
static int localNumBackends = 0;
-static volatile bool need_exit = false;
-static volatile bool need_statwrite = false;
+static volatile bool need_exit = false;
+static volatile bool need_statwrite = false;
/* ----------
@@ -199,13 +199,13 @@ pgstat_init(void)
char test_byte;
int sel_res;
int tries = 0;
-
+
#define TESTBYTEVAL ((char) 199)
/*
* Force start of collector daemon if something to collect. Note that
- * pgstat_collect_querystring is now an independent facility that does
- * not require the collector daemon.
+ * pgstat_collect_querystring is now an independent facility that does not
+ * require the collector daemon.
*/
if (pgstat_collect_tuplelevel ||
pgstat_collect_blocklevel)
@@ -262,8 +262,8 @@ pgstat_init(void)
if (++tries > 1)
ereport(LOG,
- (errmsg("trying another address for the statistics collector")));
-
+ (errmsg("trying another address for the statistics collector")));
+
/*
* Create the socket.
*/
@@ -479,7 +479,6 @@ pgstat_forkexec(void)
return postmaster_forkexec(ac, av);
}
-
#endif /* EXEC_BACKEND */
@@ -823,7 +822,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;
@@ -900,7 +899,7 @@ pgstat_report_vacuum(Oid tableoid, bool shared,
msg.m_databaseid = shared ? InvalidOid : MyDatabaseId;
msg.m_tableoid = tableoid;
msg.m_analyze = analyze;
- msg.m_autovacuum = IsAutoVacuumProcess(); /* is this autovacuum? */
+ msg.m_autovacuum = IsAutoVacuumProcess(); /* is this autovacuum? */
msg.m_vacuumtime = GetCurrentTimestamp();
msg.m_tuples = tuples;
pgstat_send(&msg, sizeof(msg));
@@ -925,7 +924,7 @@ pgstat_report_analyze(Oid tableoid, bool shared, PgStat_Counter livetuples,
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_ANALYZE);
msg.m_databaseid = shared ? InvalidOid : MyDatabaseId;
msg.m_tableoid = tableoid;
- msg.m_autovacuum = IsAutoVacuumProcess(); /* is this autovacuum? */
+ msg.m_autovacuum = IsAutoVacuumProcess(); /* is this autovacuum? */
msg.m_analyzetime = GetCurrentTimestamp();
msg.m_live_tuples = livetuples;
msg.m_dead_tuples = deadtuples;
@@ -1079,8 +1078,8 @@ pgstat_initstats(PgStat_Info *stats, Relation rel)
void
pgstat_count_xact_commit(void)
{
- if (!pgstat_collect_tuplelevel &&
- !pgstat_collect_blocklevel)
+ if (!pgstat_collect_tuplelevel &&
+ !pgstat_collect_blocklevel)
return;
pgStatXactCommit++;
@@ -1110,8 +1109,8 @@ pgstat_count_xact_commit(void)
void
pgstat_count_xact_rollback(void)
{
- if (!pgstat_collect_tuplelevel &&
- !pgstat_collect_blocklevel)
+ if (!pgstat_collect_tuplelevel &&
+ !pgstat_collect_blocklevel)
return;
pgStatXactRollback++;
@@ -1319,8 +1318,8 @@ pgstat_bestart(void)
MyBEEntry = &BackendStatusArray[MyBackendId - 1];
/*
- * To minimize the time spent modifying the entry, fetch all the
- * needed data first.
+ * To minimize the time spent modifying the entry, fetch all the needed
+ * data first.
*
* If we have a MyProcPort, use its session start time (for consistency,
* and to save a kernel call).
@@ -1343,12 +1342,13 @@ pgstat_bestart(void)
/*
* Initialize my status entry, following the protocol of bumping
- * st_changecount before and after; and make sure it's even afterwards.
- * We use a volatile pointer here to ensure the compiler doesn't try to
- * get cute.
+ * st_changecount before and after; and make sure it's even afterwards. We
+ * use a volatile pointer here to ensure the compiler doesn't try to get
+ * cute.
*/
beentry = MyBEEntry;
- do {
+ do
+ {
beentry->st_changecount++;
} while ((beentry->st_changecount & 1) == 0);
@@ -1389,9 +1389,9 @@ pgstat_beshutdown_hook(int code, Datum arg)
pgstat_report_tabstat();
/*
- * Clear my status entry, following the protocol of bumping
- * st_changecount before and after. We use a volatile pointer here
- * to ensure the compiler doesn't try to get cute.
+ * Clear my status entry, following the protocol of bumping st_changecount
+ * before and after. We use a volatile pointer here to ensure the
+ * compiler doesn't try to get cute.
*/
beentry->st_changecount++;
@@ -1420,8 +1420,8 @@ pgstat_report_activity(const char *cmd_str)
return;
/*
- * To minimize the time spent modifying the entry, fetch all the
- * needed data first.
+ * To minimize the time spent modifying the entry, fetch all the needed
+ * data first.
*/
start_timestamp = GetCurrentStatementStartTimestamp();
@@ -1430,8 +1430,8 @@ pgstat_report_activity(const char *cmd_str)
/*
* Update my status entry, following the protocol of bumping
- * st_changecount before and after. We use a volatile pointer here
- * to ensure the compiler doesn't try to get cute.
+ * st_changecount before and after. We use a volatile pointer here to
+ * ensure the compiler doesn't try to get cute.
*/
beentry->st_changecount++;
@@ -1499,20 +1499,19 @@ pgstat_read_current_status(void)
for (i = 1; i <= MaxBackends; i++)
{
/*
- * Follow the protocol of retrying if st_changecount changes while
- * we copy the entry, or if it's odd. (The check for odd is needed
- * to cover the case where we are able to completely copy the entry
- * while the source backend is between increment steps.) We use a
- * volatile pointer here to ensure the compiler doesn't try to get
- * cute.
+ * Follow the protocol of retrying if st_changecount changes while we
+ * copy the entry, or if it's odd. (The check for odd is needed to
+ * cover the case where we are able to completely copy the entry while
+ * the source backend is between increment steps.) We use a volatile
+ * pointer here to ensure the compiler doesn't try to get cute.
*/
for (;;)
{
- int save_changecount = beentry->st_changecount;
+ int save_changecount = beentry->st_changecount;
/*
- * XXX if PGBE_ACTIVITY_SIZE is really large, it might be best
- * to use strcpy not memcpy for copying the activity string?
+ * XXX if PGBE_ACTIVITY_SIZE is really large, it might be best to
+ * use strcpy not memcpy for copying the activity string?
*/
memcpy(localentry, (char *) beentry, sizeof(PgBackendStatus));
@@ -1589,7 +1588,7 @@ pgstat_send(void *msg, int len)
/* ----------
* PgstatCollectorMain() -
*
- * Start up the statistics collector process. This is the body of the
+ * Start up the statistics collector process. This is the body of the
* postmaster child process.
*
* The argc/argv parameters are valid only in EXEC_BACKEND case.
@@ -1602,6 +1601,7 @@ PgstatCollectorMain(int argc, char *argv[])
bool need_timer = false;
int len;
PgStat_Msg msg;
+
#ifdef HAVE_POLL
struct pollfd input_fd;
#else
@@ -1655,8 +1655,8 @@ PgstatCollectorMain(int argc, char *argv[])
pgstat_read_statsfile(&pgStatDBHash, InvalidOid);
/*
- * Setup the descriptor set for select(2). Since only one bit in the
- * set ever changes, we need not repeat FD_ZERO each time.
+ * Setup the descriptor set for select(2). Since only one bit in the set
+ * ever changes, we need not repeat FD_ZERO each time.
*/
#ifndef HAVE_POLL
FD_ZERO(&rfds);
@@ -1666,13 +1666,13 @@ PgstatCollectorMain(int argc, char *argv[])
* Loop to process messages until we get SIGQUIT or detect ungraceful
* death of our parent postmaster.
*
- * For performance reasons, we don't want to do a PostmasterIsAlive()
- * test after every message; instead, do it at statwrite time and if
+ * For performance reasons, we don't want to do a PostmasterIsAlive() test
+ * after every message; instead, do it at statwrite time and if
* select()/poll() is interrupted by timeout.
*/
for (;;)
{
- int got_data;
+ int got_data;
/*
* Quit if we get SIGQUIT from the postmaster.
@@ -1681,7 +1681,7 @@ PgstatCollectorMain(int argc, char *argv[])
break;
/*
- * If time to write the stats file, do so. Note that the alarm
+ * If time to write the stats file, do so. Note that the alarm
* interrupt isn't re-enabled immediately, but only after we next
* receive a stats message; so no cycles are wasted when there is
* nothing going on.
@@ -1701,9 +1701,9 @@ PgstatCollectorMain(int argc, char *argv[])
* Wait for a message to arrive; but not for more than
* PGSTAT_SELECT_TIMEOUT seconds. (This determines how quickly we will
* shut down after an ungraceful postmaster termination; so it needn't
- * be very fast. However, on some systems SIGQUIT won't interrupt
- * the poll/select call, so this also limits speed of response to
- * SIGQUIT, which is more important.)
+ * be very fast. However, on some systems SIGQUIT won't interrupt the
+ * poll/select call, so this also limits speed of response to SIGQUIT,
+ * which is more important.)
*
* We use poll(2) if available, otherwise select(2)
*/
@@ -1722,7 +1722,6 @@ PgstatCollectorMain(int argc, char *argv[])
}
got_data = (input_fd.revents != 0);
-
#else /* !HAVE_POLL */
FD_SET(pgStatSock, &rfds);
@@ -1744,7 +1743,6 @@ PgstatCollectorMain(int argc, char *argv[])
}
got_data = FD_ISSET(pgStatSock, &rfds);
-
#endif /* HAVE_POLL */
/*
@@ -1826,20 +1824,20 @@ PgstatCollectorMain(int argc, char *argv[])
{
if (setitimer(ITIMER_REAL, &write_timeout, NULL))
ereport(ERROR,
- (errmsg("could not set statistics collector timer: %m")));
+ (errmsg("could not set statistics collector timer: %m")));
need_timer = false;
}
}
else
{
/*
- * We can only get here if the select/poll timeout elapsed.
- * Check for postmaster death.
+ * We can only get here if the select/poll timeout elapsed. Check
+ * for postmaster death.
*/
if (!PostmasterIsAlive(true))
break;
}
- } /* end of message-processing loop */
+ } /* end of message-processing loop */
/*
* Save the final stats to reuse at next startup.
@@ -1953,9 +1951,9 @@ pgstat_write_statsfile(void)
while ((dbentry = (PgStat_StatDBEntry *) hash_seq_search(&hstat)) != NULL)
{
/*
- * Write out the DB entry including the number of live backends.
- * We don't write the tables pointer since it's of no use to any
- * other process.
+ * Write out the DB entry including the number of live backends. We
+ * don't write the tables pointer since it's of no use to any other
+ * process.
*/
fputc('D', fpout);
fwrite(dbentry, offsetof(PgStat_StatDBEntry, tables), 1, fpout);
@@ -1987,8 +1985,8 @@ pgstat_write_statsfile(void)
{
ereport(LOG,
(errcode_for_file_access(),
- errmsg("could not write temporary statistics file \"%s\": %m",
- PGSTAT_STAT_TMPFILE)));
+ errmsg("could not write temporary statistics file \"%s\": %m",
+ PGSTAT_STAT_TMPFILE)));
fclose(fpout);
unlink(PGSTAT_STAT_TMPFILE);
}
@@ -2491,10 +2489,10 @@ pgstat_recv_vacuum(PgStat_MsgVacuum *msg, int len)
if (tabentry == NULL)
return;
- if (msg->m_autovacuum)
+ if (msg->m_autovacuum)
tabentry->autovac_vacuum_timestamp = msg->m_vacuumtime;
- else
- tabentry->vacuum_timestamp = msg->m_vacuumtime;
+ else
+ tabentry->vacuum_timestamp = msg->m_vacuumtime;
tabentry->n_live_tuples = msg->m_tuples;
tabentry->n_dead_tuples = 0;
if (msg->m_analyze)
@@ -2539,9 +2537,9 @@ pgstat_recv_analyze(PgStat_MsgAnalyze *msg, int len)
if (tabentry == NULL)
return;
- if (msg->m_autovacuum)
+ if (msg->m_autovacuum)
tabentry->autovac_analyze_timestamp = msg->m_analyzetime;
- else
+ else
tabentry->analyze_timestamp = msg->m_analyzetime;
tabentry->n_live_tuples = msg->m_live_tuples;
tabentry->n_dead_tuples = msg->m_dead_tuples;
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 130415c74cb..ed4de726980 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.499 2006/08/15 18:26:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.500 2006/10/04 00:29:56 momjian Exp $
*
* NOTES
*
@@ -141,9 +141,9 @@ typedef struct bkend
static Dllist *BackendList;
#ifdef EXEC_BACKEND
-/*
+/*
* Number of entries in the backend table. Twice the number of backends,
- * plus four other subprocesses (stats, bgwriter, autovac, logger).
+ * plus four other subprocesses (stats, bgwriter, autovac, logger).
*/
#define NUM_BACKENDARRAY_ELEMS (2*MaxBackends + 4)
static Backend *ShmemBackendArray;
@@ -510,6 +510,7 @@ PostmasterMain(int argc, char *argv[])
break;
case 'T':
+
/*
* In the event that some backend dumps core, send SIGSTOP,
* rather than SIGQUIT, to all its peers. This lets the wily
@@ -519,21 +520,21 @@ PostmasterMain(int argc, char *argv[])
break;
case 't':
- {
- const char *tmp = get_stats_option_name(optarg);
-
- if (tmp)
{
- SetConfigOption(tmp, "true", PGC_POSTMASTER, PGC_S_ARGV);
- }
- else
- {
- write_stderr("%s: invalid argument for option -t: \"%s\"\n",
- progname, optarg);
- ExitPostmaster(1);
+ const char *tmp = get_stats_option_name(optarg);
+
+ if (tmp)
+ {
+ SetConfigOption(tmp, "true", PGC_POSTMASTER, PGC_S_ARGV);
+ }
+ else
+ {
+ write_stderr("%s: invalid argument for option -t: \"%s\"\n",
+ progname, optarg);
+ ExitPostmaster(1);
+ }
+ break;
}
- break;
- }
case 'W':
SetConfigOption("post_auth_delay", optarg, PGC_POSTMASTER, PGC_S_ARGV);
@@ -2468,9 +2469,9 @@ BackendStartup(Port *port)
* postmaster's listen sockets. (In EXEC_BACKEND case this is all
* done in SubPostmasterMain.)
*/
- IsUnderPostmaster = true; /* we are a postmaster subprocess now */
+ IsUnderPostmaster = true; /* we are a postmaster subprocess now */
- MyProcPid = getpid(); /* reset MyProcPid */
+ MyProcPid = getpid(); /* reset MyProcPid */
/* We don't want the postmaster's proc_exit() handlers */
on_exit_reset();
@@ -2718,8 +2719,8 @@ BackendInitialize(Port *port)
* title for ps. It's good to do this as early as possible in startup.
*/
init_ps_display(port->user_name, port->database_name, remote_ps_data,
- update_process_title ? "authentication" : "");
-
+ update_process_title ? "authentication" : "");
+
/*
* Now perform authentication exchange.
*/
@@ -3252,12 +3253,11 @@ SubPostmasterMain(int argc, char *argv[])
/*
* Perform additional initialization and client authentication.
*
- * We want to do this before InitProcess() for a couple of reasons:
- * 1. so that we aren't eating up a PGPROC slot while waiting on the
- * client.
- * 2. so that if InitProcess() fails due to being out of PGPROC slots,
- * we have already initialized libpq and are able to report the error
- * to the client.
+ * We want to do this before InitProcess() for a couple of reasons: 1.
+ * so that we aren't eating up a PGPROC slot while waiting on the
+ * client. 2. so that if InitProcess() fails due to being out of
+ * PGPROC slots, we have already initialized libpq and are able to
+ * report the error to the client.
*/
BackendInitialize(&port);
@@ -3268,16 +3268,15 @@ SubPostmasterMain(int argc, char *argv[])
InitProcess();
/*
- * Attach process to shared data structures. If testing
- * EXEC_BACKEND on Linux, you must run this as root
- * before starting the postmaster:
+ * Attach process to shared data structures. If testing EXEC_BACKEND
+ * on Linux, you must run this as root before starting the postmaster:
*
- * echo 0 >/proc/sys/kernel/randomize_va_space
+ * echo 0 >/proc/sys/kernel/randomize_va_space
*
- * This prevents a randomized stack base address that causes
- * child shared memory to be at a different address than
- * the parent, making it impossible to attached to shared
- * memory. Return the value to '1' when finished.
+ * This prevents a randomized stack base address that causes child
+ * shared memory to be at a different address than the parent, making
+ * it impossible to attached to shared memory. Return the value to
+ * '1' when finished.
*/
CreateSharedMemoryAndSemaphores(false, 0);