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

Commit6521cd9

Browse files
committed
Add 'static' to initdb.c file-global variables.
1 parentc5159bc commit6521cd9

File tree

1 file changed

+47
-49
lines changed

1 file changed

+47
-49
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 47 additions & 49 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.77 2005/03/07 04:30:55 momjian Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.78 2005/03/11 15:36:27 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -71,62 +71,60 @@ intoptreset;
7171
/*
7272
* these values are passed in by makefile defines
7373
*/
74-
char*share_path=NULL;
74+
staticchar*share_path=NULL;
7575

7676
/* values to be obtained from arguments */
77-
char*pg_data="";
78-
char*encoding="";
79-
char*locale="";
80-
char*lc_collate="";
81-
char*lc_ctype="";
82-
char*lc_monetary="";
83-
char*lc_numeric="";
84-
char*lc_time="";
85-
char*lc_messages="";
86-
char*username="";
87-
boolpwprompt= false;
88-
char*pwfilename=NULL;
89-
char*authmethod="";
90-
booldebug= false;
91-
boolnoclean= false;
92-
boolshow_setting= false;
77+
staticchar*pg_data="";
78+
staticchar*encoding="";
79+
staticchar*locale="";
80+
staticchar*lc_collate="";
81+
staticchar*lc_ctype="";
82+
staticchar*lc_monetary="";
83+
staticchar*lc_numeric="";
84+
staticchar*lc_time="";
85+
staticchar*lc_messages="";
86+
staticchar*username="";
87+
staticboolpwprompt= false;
88+
staticchar*pwfilename=NULL;
89+
staticchar*authmethod="";
90+
staticbooldebug= false;
91+
staticboolnoclean= false;
92+
staticboolshow_setting= false;
9393

9494

9595
/* internal vars */
96-
constchar*progname;
97-
char*postgres;
98-
char*encodingid="0";
99-
char*bki_file;
100-
char*desc_file;
101-
char*hba_file;
102-
char*ident_file;
103-
char*conf_file;
104-
char*conversion_file;
105-
char*info_schema_file;
106-
char*features_file;
107-
char*system_views_file;
108-
char*effective_user;
109-
booltestpath= true;
110-
boolmade_new_pgdata= false;
111-
boolfound_existing_pgdata= false;
112-
charinfoversion[100];
113-
boolcaught_signal= false;
114-
booloutput_failed= false;
115-
intoutput_errno=0;
96+
staticconstchar*progname;
97+
staticchar*encodingid="0";
98+
staticchar*bki_file;
99+
staticchar*desc_file;
100+
staticchar*hba_file;
101+
staticchar*ident_file;
102+
staticchar*conf_file;
103+
staticchar*conversion_file;
104+
staticchar*info_schema_file;
105+
staticchar*features_file;
106+
staticchar*system_views_file;
107+
staticchar*effective_user;
108+
staticboolmade_new_pgdata= false;
109+
staticboolfound_existing_pgdata= false;
110+
staticcharinfoversion[100];
111+
staticboolcaught_signal= false;
112+
staticbooloutput_failed= false;
113+
staticintoutput_errno=0;
116114

117115
/* defaults */
118-
intn_connections=10;
119-
intn_buffers=50;
116+
staticintn_connections=10;
117+
staticintn_buffers=50;
120118

121119
/*
122120
* Warning messages for authentication methods
123121
*/
124-
char*authtrust_warning= \
125-
"# CAUTION: Configuring the system for local \"trust\" authentication allows\n"
126-
"# any local user to connect as any PostgreSQL user, including the database\n"
127-
"# superuser. If you do not trust all your local users, use another\n"
128-
"# authentication method.\n";
129-
char*authwarning=NULL;
122+
#defineAUTHTRUST_WARNING \
123+
"# CAUTION: Configuring the system for local \"trust\" authentication allows\n" \
124+
"# any local user to connect as any PostgreSQL user, including the database\n" \
125+
"# superuser. If you do not trust all your local users, use another\n" \
126+
"# authentication method.\n"
127+
staticchar*authwarning=NULL;
130128

131129
/*
132130
* Centralized knowledge of switches to pass to backend
@@ -140,8 +138,8 @@ static const char *backend_options = "-F -O -c search_path=pg_catalog -c exit_on
140138

141139

142140
/* path to 'initdb' binary directory */
143-
charbin_path[MAXPGPATH];
144-
charbackend_exec[MAXPGPATH];
141+
staticcharbin_path[MAXPGPATH];
142+
staticcharbackend_exec[MAXPGPATH];
145143

146144
staticvoid*xmalloc(size_tsize);
147145
staticchar*xstrdup(constchar*s);
@@ -1210,7 +1208,7 @@ setup_config(void)
12101208

12111209
conflines=replace_token(conflines,
12121210
"@authcomment@",
1213-
strcmp(authmethod,"trust") ?"" :authtrust_warning);
1211+
strcmp(authmethod,"trust") ?"" :AUTHTRUST_WARNING);
12141212

12151213
snprintf(path,sizeof(path),"%s/pg_hba.conf",pg_data);
12161214

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp