Skip to content

Commit d4a9004

Browse files
committed
Cosmetic cleanups in initdb.c.
Commit bcbd940 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.
1 parent f841ceb commit d4a9004

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bin/initdb/initdb.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static char *pgdata_native;
173173
/* defaults */
174174
static int n_connections = 10;
175175
static int n_buffers = 50;
176-
static char *dynamic_shared_memory_type = NULL;
176+
static const char *dynamic_shared_memory_type = NULL;
177177

178178
/*
179179
* Warning messages for authentication methods
@@ -916,7 +916,7 @@ set_null_conf(void)
916916
* the postmaster either, and configure the cluster for System V shared
917917
* memory instead.
918918
*/
919-
static char *
919+
static const char *
920920
choose_dsm_implementation(void)
921921
{
922922
#ifdef HAVE_SHM_OPEN
@@ -952,9 +952,7 @@ choose_dsm_implementation(void)
952952
/*
953953
* Determine platform-specific config settings
954954
*
955-
* Use reasonable values if kernel will let us, else scale back. Probe
956-
* for max_connections first since it is subject to more constraints than
957-
* shared_buffers.
955+
* Use reasonable values if kernel will let us, else scale back.
958956
*/
959957
static void
960958
test_config_settings(void)
@@ -983,7 +981,6 @@ test_config_settings(void)
983981
test_buffs,
984982
ok_buffers = 0;
985983

986-
987984
/*
988985
* Need to determine working DSM implementation first so that subsequent
989986
* tests don't fail because DSM setting doesn't work.
@@ -993,6 +990,10 @@ test_config_settings(void)
993990
dynamic_shared_memory_type = choose_dsm_implementation();
994991
printf("%s\n", dynamic_shared_memory_type);
995992

993+
/*
994+
* Probe for max_connections before shared_buffers, since it is subject to
995+
* more constraints than shared_buffers.
996+
*/
996997
printf(_("selecting default max_connections ... "));
997998
fflush(stdout);
998999

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy