Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bb44a7c5
Commit
bb44a7c5
authored
May 27, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pgindent files for Tom.
parent
83526ccf
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
284 additions
and
250 deletions
+284
-250
src/backend/main/main.c
src/backend/main/main.c
+43
-39
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+241
-211
No files found.
src/backend/main/main.c
View file @
bb44a7c5
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.8
2 2004/05/25 01:00:2
0 momjian Exp $
* $PostgreSQL: pgsql/src/backend/main/main.c,v 1.8
3 2004/05/27 15:07:4
0 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -50,6 +50,7 @@ int
...
@@ -50,6 +50,7 @@ int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
int
len
;
int
len
;
#ifndef WIN32
#ifndef WIN32
struct
passwd
*
pw
;
struct
passwd
*
pw
;
#endif
#endif
...
@@ -100,11 +101,11 @@ main(int argc, char *argv[])
...
@@ -100,11 +101,11 @@ main(int argc, char *argv[])
int
err
;
int
err
;
/* Make output streams unbuffered by default */
/* Make output streams unbuffered by default */
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stderr
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stderr
,
NULL
,
_IONBF
,
0
);
/* Prepare Winsock */
/* Prepare Winsock */
err
=
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
wsaData
);
err
=
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
wsaData
);
if
(
err
!=
0
)
if
(
err
!=
0
)
{
{
fprintf
(
stderr
,
"%s: WSAStartup failed: %d
\n
"
,
fprintf
(
stderr
,
"%s: WSAStartup failed: %d
\n
"
,
...
@@ -130,14 +131,14 @@ main(int argc, char *argv[])
...
@@ -130,14 +131,14 @@ main(int argc, char *argv[])
/*
/*
* Remember the physical location of the initially given argv[] array
* Remember the physical location of the initially given argv[] array
* for possible use by ps display. On some platforms, the argv[]
* for possible use by ps display. On some platforms, the argv[]
* storage must be overwritten in order to set the process title for
ps.
* storage must be overwritten in order to set the process title for
*
In such cases save_ps_display_args makes and returns a new copy of
*
ps. In such cases save_ps_display_args makes and returns a new copy
* the argv[] array.
*
of
the argv[] array.
*
*
* save_ps_display_args may also move the environment strings to make
* save_ps_display_args may also move the environment strings to make
* extra room. Therefore this should be done as early as possible
during
* extra room. Therefore this should be done as early as possible
*
startup, to avoid entanglements with code that might save a getenv()
*
during startup, to avoid entanglements with code that might save a
* result pointer.
*
getenv()
result pointer.
*/
*/
argv
=
save_ps_display_args
(
argc
,
argv
);
argv
=
save_ps_display_args
(
argc
,
argv
);
...
@@ -145,29 +146,30 @@ main(int argc, char *argv[])
...
@@ -145,29 +146,30 @@ main(int argc, char *argv[])
* Set up locale information from environment. Note that LC_CTYPE and
* Set up locale information from environment. Note that LC_CTYPE and
* LC_COLLATE will be overridden later from pg_control if we are in an
* LC_COLLATE will be overridden later from pg_control if we are in an
* already-initialized database. We set them here so that they will
* already-initialized database. We set them here so that they will
* be available to fill pg_control during initdb. LC_MESSAGES will
get
* be available to fill pg_control during initdb. LC_MESSAGES will
*
set later during GUC option processing, but we set it here to allow
*
get set later during GUC option processing, but we set it here to
* startup error messages to be localized.
*
allow
startup error messages to be localized.
*/
*/
set_pglocale
(
argv
[
0
],
"postgres"
);
set_pglocale
(
argv
[
0
],
"postgres"
);
#ifdef WIN32
#ifdef WIN32
/*
/*
* Windows uses codepages rather than the environment, so we work
around
* Windows uses codepages rather than the environment, so we work
*
that by querying the environment explicitly first for LC_COLLATE
*
around that by querying the environment explicitly first for
*
and LC_CTYPE. We have to do this because initdb passes those valu
es
*
LC_COLLATE and LC_CTYPE. We have to do this because initdb pass
es
*
in the environment. If there is nothing there we fall back on the
*
those values in the environment. If there is nothing there we fall
* codepage.
*
back on the
codepage.
*/
*/
if
((
env_locale
=
getenv
(
"LC_COLLATE"
))
!=
NULL
)
if
((
env_locale
=
getenv
(
"LC_COLLATE"
))
!=
NULL
)
setlocale
(
LC_COLLATE
,
env_locale
);
setlocale
(
LC_COLLATE
,
env_locale
);
else
else
setlocale
(
LC_COLLATE
,
""
);
setlocale
(
LC_COLLATE
,
""
);
if
((
env_locale
=
getenv
(
"LC_CTYPE"
))
!=
NULL
)
if
((
env_locale
=
getenv
(
"LC_CTYPE"
))
!=
NULL
)
setlocale
(
LC_CTYPE
,
env_locale
);
setlocale
(
LC_CTYPE
,
env_locale
);
else
else
setlocale
(
LC_CTYPE
,
""
);
setlocale
(
LC_CTYPE
,
""
);
#else
#else
...
@@ -241,8 +243,8 @@ main(int argc, char *argv[])
...
@@ -241,8 +243,8 @@ main(int argc, char *argv[])
/*
/*
* Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain,
* Now dispatch to one of PostmasterMain, PostgresMain, GucInfoMain,
* SubPostmasterMain, pgstat_main, pgstat_mainChild or BootstrapMain
* SubPostmasterMain, pgstat_main, pgstat_mainChild or BootstrapMain
* depending on the program name (and possibly first argument) we
* depending on the program name (and possibly first argument) we
were
*
were
called with. The lack of consistency here is historical.
* called with. The lack of consistency here is historical.
*/
*/
len
=
strlen
(
argv
[
0
]);
len
=
strlen
(
argv
[
0
]);
...
@@ -264,9 +266,11 @@ main(int argc, char *argv[])
...
@@ -264,9 +266,11 @@ main(int argc, char *argv[])
exit
(
BootstrapMain
(
argc
-
1
,
argv
+
1
));
exit
(
BootstrapMain
(
argc
-
1
,
argv
+
1
));
#ifdef EXEC_BACKEND
#ifdef EXEC_BACKEND
/*
/*
* If the first argument is "-forkexec", then invoke SubPostmasterMain. Note
* If the first argument is "-forkexec", then invoke
* we remove "-forkexec" from the arguments passed on to SubPostmasterMain.
* SubPostmasterMain. Note we remove "-forkexec" from the arguments
* passed on to SubPostmasterMain.
*/
*/
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-forkexec"
)
==
0
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-forkexec"
)
==
0
)
{
{
...
@@ -279,7 +283,7 @@ main(int argc, char *argv[])
...
@@ -279,7 +283,7 @@ main(int argc, char *argv[])
*/
*/
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-statBuf"
)
==
0
)
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-statBuf"
)
==
0
)
{
{
pgstat_main
(
argc
,
argv
);
pgstat_main
(
argc
,
argv
);
exit
(
0
);
exit
(
0
);
}
}
...
...
src/backend/postmaster/postmaster.c
View file @
bb44a7c5
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment