Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit361f354

Browse files
committed
Make sure --with-pgport option propagates into postgresql.conf.
Per gripe from Josh Berkus.
1 parent3947599 commit361f354

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.70 2004/11/29 03:05:03 tgl Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.71 2004/12/27 20:39:21 tgl Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -147,9 +147,10 @@ charbackend_exec[MAXPGPATH];
147147

148148
staticvoid*xmalloc(size_tsize);
149149
staticchar*xstrdup(constchar*s);
150-
staticchar**replace_token(char**lines,char*token,char*replacement);
150+
staticchar**replace_token(char**lines,
151+
constchar*token,constchar*replacement);
151152
#ifndefHAVE_UNIX_SOCKETS
152-
staticchar**filter_lines_with_token(char**lines,char*token);
153+
staticchar**filter_lines_with_token(char**lines,constchar*token);
153154
#endif
154155
staticchar**readfile(char*path);
155156
staticvoidwritefile(char*path,char**lines);
@@ -275,7 +276,7 @@ xstrdup(const char *s)
275276
* doesn't need any regexp stuff.
276277
*/
277278
staticchar**
278-
replace_token(char**lines,char*token,char*replacement)
279+
replace_token(char**lines,constchar*token,constchar*replacement)
279280
{
280281
intnumlines=1;
281282
inti;
@@ -300,7 +301,6 @@ replace_token(char **lines, char *token, char *replacement)
300301
intpre;
301302

302303
/* just copy pointer if NULL or no change needed */
303-
304304
if (lines[i]==NULL|| (where=strstr(lines[i],token))==NULL)
305305
{
306306
result[i]=lines[i];
@@ -320,21 +320,19 @@ replace_token(char **lines, char *token, char *replacement)
320320
strcpy(newline+pre+replen,lines[i]+pre+toklen);
321321

322322
result[i]=newline;
323-
324323
}
325324

326325
returnresult;
327-
328326
}
329327

330328
/*
331329
* make a copy of lines without any that contain the token
332-
* a sort of poor man's grep -v
333330
*
331+
* a sort of poor man's grep -v
334332
*/
335333
#ifndefHAVE_UNIX_SOCKETS
336334
staticchar**
337-
filter_lines_with_token(char**lines,char*token)
335+
filter_lines_with_token(char**lines,constchar*token)
338336
{
339337
intnumlines=1;
340338
inti,src,dst;
@@ -1165,6 +1163,11 @@ setup_config(void)
11651163
snprintf(repltok,sizeof(repltok),"shared_buffers = %d",n_buffers);
11661164
conflines=replace_token(conflines,"#shared_buffers = 1000",repltok);
11671165

1166+
#ifDEF_PGPORT!=5432
1167+
snprintf(repltok,sizeof(repltok),"#port = %d",DEF_PGPORT);
1168+
conflines=replace_token(conflines,"#port = 5432",repltok);
1169+
#endif
1170+
11681171
lc_messages=escape_quotes(lc_messages);
11691172
snprintf(repltok,sizeof(repltok),"lc_messages = '%s'",lc_messages);
11701173
conflines=replace_token(conflines,"#lc_messages = 'C'",repltok);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp