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
c8fe66df
Commit
c8fe66df
authored
Jul 03, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't go into infinite loop if /home/postgres/testversion/data directory is not writable.
parent
86bc2d91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+7
-4
No files found.
src/backend/utils/init/miscinit.c
View file @
c8fe66df
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.7
2 2001/06/20 18:07:56 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.7
3 2001/07/03 16:49:48 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -539,15 +539,18 @@ CreateLockFile(const char *filename, bool amPostmaster,
{
int
fd
;
char
buffer
[
MAXPGPATH
+
100
];
int
ntries
;
int
len
;
int
encoded_pid
;
pid_t
other_pid
;
pid_t
my_pid
=
getpid
();
/*
* We need a loop here because of race conditions.
* We need a loop here because of race conditions. But don't loop
* forever (for example, a non-writable $PGDATA directory might cause
* a failure that won't go away). 100 tries seems like plenty.
*/
for
(
;;
)
for
(
ntries
=
0
;
;
ntries
++
)
{
/*
...
...
@@ -560,7 +563,7 @@ CreateLockFile(const char *filename, bool amPostmaster,
/*
* Couldn't create the pid file. Probably it already exists.
*/
if
(
errno
!=
EEXIST
&&
errno
!=
EACCES
)
if
(
(
errno
!=
EEXIST
&&
errno
!=
EACCES
)
||
ntries
>
100
)
elog
(
FATAL
,
"Can't create lock file %s: %m"
,
filename
);
/*
...
...
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