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
3825963e
Commit
3825963e
authored
Aug 29, 2012
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report postmaster.pid file as empty if it is empty, rather than
reporting in contains invalid data.
parent
c82dedb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+8
-0
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+7
-2
No files found.
src/backend/utils/init/miscinit.c
View file @
3825963e
...
...
@@ -766,6 +766,14 @@ CreateLockFile(const char *filename, bool amPostmaster,
filename
)));
close
(
fd
);
if
(
len
==
0
)
{
ereport
(
FATAL
,
(
errcode
(
ERRCODE_LOCK_FILE_EXISTS
),
errmsg
(
"lock file
\"
%s
\"
is empty"
,
filename
),
errhint
(
"Either another server is starting, or the lock file is the remnant of a previous server startup crash."
)));
}
buffer
[
len
]
=
'\0'
;
encoded_pid
=
atoi
(
buffer
);
...
...
src/bin/pg_ctl/pg_ctl.c
View file @
3825963e
...
...
@@ -292,8 +292,13 @@ get_pgpid(void)
}
if
(
fscanf
(
pidf
,
"%ld"
,
&
pid
)
!=
1
)
{
write_stderr
(
_
(
"%s: invalid data in PID file
\"
%s
\"\n
"
),
progname
,
pid_file
);
/* Is the file empty? */
if
(
ftell
(
pidf
)
==
0
&&
feof
(
pidf
))
write_stderr
(
_
(
"%s: the PID file
\"
%s
\"
is empty
\n
"
),
progname
,
pid_file
);
else
write_stderr
(
_
(
"%s: invalid data in PID file
\"
%s
\"\n
"
),
progname
,
pid_file
);
exit
(
1
);
}
fclose
(
pidf
);
...
...
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