aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-08-10 14:14:27 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-08-10 14:14:27 -0400
commitd4a900458e505092a8013eb77c9631d58c3c2a0a (patch)
tree2e8516f63dfe32ba1756ec5e987d30156311c7f0 /src
parentf841ceb26d701e7f5f48190bf7290c400cba30a2 (diff)
downloadpostgresql-d4a900458e505092a8013eb77c9631d58c3c2a0a.tar.gz
postgresql-d4a900458e505092a8013eb77c9631d58c3c2a0a.zip
Cosmetic cleanups in initdb.c.
Commit bcbd94080 didn't bother to fix up a comment it had falsified. Also, const-ify choose_dsm_implementation(), since what it's returning is always a constant string; pickier compilers would warn about this.
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 3f203c6ca6d..32746c77032 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -173,7 +173,7 @@ static char *pgdata_native;
/* defaults */
static int n_connections = 10;
static int n_buffers = 50;
-static char *dynamic_shared_memory_type = NULL;
+static const char *dynamic_shared_memory_type = NULL;
/*
* Warning messages for authentication methods
@@ -916,7 +916,7 @@ set_null_conf(void)
* the postmaster either, and configure the cluster for System V shared
* memory instead.
*/
-static char *
+static const char *
choose_dsm_implementation(void)
{
#ifdef HAVE_SHM_OPEN
@@ -952,9 +952,7 @@ choose_dsm_implementation(void)
/*
* Determine platform-specific config settings
*
- * Use reasonable values if kernel will let us, else scale back. Probe
- * for max_connections first since it is subject to more constraints than
- * shared_buffers.
+ * Use reasonable values if kernel will let us, else scale back.
*/
static void
test_config_settings(void)
@@ -983,7 +981,6 @@ test_config_settings(void)
test_buffs,
ok_buffers = 0;
-
/*
* Need to determine working DSM implementation first so that subsequent
* tests don't fail because DSM setting doesn't work.
@@ -993,6 +990,10 @@ test_config_settings(void)
dynamic_shared_memory_type = choose_dsm_implementation();
printf("%s\n", dynamic_shared_memory_type);
+ /*
+ * Probe for max_connections before shared_buffers, since it is subject to
+ * more constraints than shared_buffers.
+ */
printf(_("selecting default max_connections ... "));
fflush(stdout);