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
379268aa
Commit
379268aa
authored
Oct 19, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper fix for glibc getopt() botch. Surprising we did not see this
before.
parent
58f6b951
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
75 deletions
+132
-75
configure
configure
+91
-58
configure.in
configure.in
+9
-0
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+28
-16
src/include/pg_config.h.in
src/include/pg_config.h.in
+4
-1
No files found.
configure
View file @
379268aa
This diff is collapsed.
Click to expand it.
configure.in
View file @
379268aa
...
@@ -985,6 +985,15 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
...
@@ -985,6 +985,15 @@ if test x"$pgac_cv_var_int_optreset" = x"yes"; then
AC_DEFINE(HAVE_INT_OPTRESET, 1)
AC_DEFINE(HAVE_INT_OPTRESET, 1)
fi
fi
AC_CACHE_CHECK([for __getopt_initialized], pgac_cv_var_int___getopt_initialized,
[AC_TRY_LINK([#include <unistd.h>],
[extern int __getopt_initialized; __getopt_initialized = 1;],
[pgac_cv_var_int___getopt_initialized=yes],
[pgac_cv_var_int___getopt_initialized=no])])
if test x"$pgac_cv_var_int___getopt_initialized" = x"yes"; then
AC_DEFINE(HAVE_INT___GETOPT_INITIALIZED, 1)
fi
# This test makes sure that run tests work at all. Sometimes a shared
# This test makes sure that run tests work at all. Sometimes a shared
# library is found by the linker, but the runtime linker can't find it.
# library is found by the linker, but the runtime linker can't find it.
...
...
src/backend/postmaster/postmaster.c
View file @
379268aa
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.24
8 2001/10/19 18:19:41
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.24
9 2001/10/19 20:47:09
tgl Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -228,6 +228,9 @@ extern int optind,
...
@@ -228,6 +228,9 @@ extern int optind,
#ifdef HAVE_INT_OPTRESET
#ifdef HAVE_INT_OPTRESET
extern
int
optreset
;
extern
int
optreset
;
#endif
#endif
#ifdef HAVE_INT___GETOPT_INITIALIZED
extern
int
__getopt_initialized
;
#endif
/*
/*
* postmaster.c - function prototypes
* postmaster.c - function prototypes
...
@@ -355,7 +358,6 @@ PostmasterMain(int argc, char *argv[])
...
@@ -355,7 +358,6 @@ PostmasterMain(int argc, char *argv[])
}
}
}
}
/*
/*
* for security, no dir or file created can be group or other
* for security, no dir or file created can be group or other
* accessible
* accessible
...
@@ -422,12 +424,13 @@ PostmasterMain(int argc, char *argv[])
...
@@ -422,12 +424,13 @@ PostmasterMain(int argc, char *argv[])
}
}
/*
/*
*
Non-option switch arguments don't exist
.
*
Postmaster accepts no non-option switch arguments
.
*/
*/
if
(
optind
<
argc
)
if
(
optind
<
argc
)
{
{
postmaster_error
(
"invalid argument -- %s"
,
argv
[
optind
]);
postmaster_error
(
"invalid argument -- %s"
,
argv
[
optind
]);
fprintf
(
stderr
,
gettext
(
"Try '%s --help' for more information.
\n
"
),
progname
);
fprintf
(
stderr
,
gettext
(
"Try '%s --help' for more information.
\n
"
),
progname
);
ExitPostmaster
(
1
);
ExitPostmaster
(
1
);
}
}
...
@@ -438,10 +441,15 @@ PostmasterMain(int argc, char *argv[])
...
@@ -438,10 +441,15 @@ PostmasterMain(int argc, char *argv[])
IgnoreSystemIndexes
(
false
);
IgnoreSystemIndexes
(
false
);
optind
=
1
;
/* start over (should be redundant here) */
/* reset getopt(3) to rescan arguments */
optind
=
1
;
#ifdef HAVE_INT_OPTRESET
#ifdef HAVE_INT_OPTRESET
optreset
=
1
;
optreset
=
1
;
/* some systems need this */
#endif
#ifdef HAVE_INT___GETOPT_INITIALIZED
__getopt_initialized
=
0
;
/* glibc needs this */
#endif
#endif
while
((
opt
=
getopt
(
argc
,
argv
,
"A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:"
))
!=
EOF
)
while
((
opt
=
getopt
(
argc
,
argv
,
"A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:"
))
!=
EOF
)
{
{
switch
(
opt
)
switch
(
opt
)
...
@@ -584,6 +592,20 @@ PostmasterMain(int argc, char *argv[])
...
@@ -584,6 +592,20 @@ PostmasterMain(int argc, char *argv[])
ExitPostmaster
(
1
);
ExitPostmaster
(
1
);
}
}
/*
* Now that we are done processing the postmaster arguments,
* reset getopt(3) library so that it will work correctly in
* subprocesses.
*/
optind
=
1
;
#ifdef HAVE_INT_OPTRESET
optreset
=
1
;
/* some systems need this */
#endif
#ifdef HAVE_INT___GETOPT_INITIALIZED
__getopt_initialized
=
0
;
/* glibc needs this */
#endif
/* For debugging: display postmaster environment */
if
(
DebugLvl
>
2
)
if
(
DebugLvl
>
2
)
{
{
extern
char
**
environ
;
extern
char
**
environ
;
...
@@ -2179,11 +2201,6 @@ DoBackend(Port *port)
...
@@ -2179,11 +2201,6 @@ DoBackend(Port *port)
av
[
ac
]
=
(
char
*
)
NULL
;
av
[
ac
]
=
(
char
*
)
NULL
;
optind
=
1
;
/* reset getopt(3) for subprocess */
#ifdef HAVE_INT_OPTRESET
optreset
=
1
;
#endif
/*
/*
* Release postmaster's working memory context so that backend can
* Release postmaster's working memory context so that backend can
* recycle the space. Note this does not trash *MyProcPort, because
* recycle the space. Note this does not trash *MyProcPort, because
...
@@ -2473,11 +2490,6 @@ SSDataBase(int xlop)
...
@@ -2473,11 +2490,6 @@ SSDataBase(int xlop)
av
[
ac
]
=
(
char
*
)
NULL
;
av
[
ac
]
=
(
char
*
)
NULL
;
optind
=
1
;
/* reset getopt(3) for subprocess */
#ifdef HAVE_INT_OPTRESET
optreset
=
1
;
#endif
BootstrapMain
(
ac
,
av
);
BootstrapMain
(
ac
,
av
);
ExitPostmaster
(
0
);
ExitPostmaster
(
0
);
}
}
...
...
src/include/pg_config.h.in
View file @
379268aa
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
* changes will be overwritten the next time you run configure.
* changes will be overwritten the next time you run configure.
*
*
* $Id: pg_config.h.in,v 1.
9 2001/10/13 04:23:50 momjian
Exp $
* $Id: pg_config.h.in,v 1.
10 2001/10/19 20:47:09 tgl
Exp $
*/
*/
#ifndef PG_CONFIG_H
#ifndef PG_CONFIG_H
...
@@ -667,6 +667,9 @@ extern int fdatasync(int fildes);
...
@@ -667,6 +667,9 @@ extern int fdatasync(int fildes);
/* Define if you have the optreset variable */
/* Define if you have the optreset variable */
#undef HAVE_INT_OPTRESET
#undef HAVE_INT_OPTRESET
/* Define if you have the __getopt_initialized variable */
#undef HAVE_INT___GETOPT_INITIALIZED
/* Define if you have strtoll() */
/* Define if you have strtoll() */
#undef HAVE_STRTOLL
#undef HAVE_STRTOLL
...
...
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