postgresql/src/backend
Robert Haas 24ecde7742 Work around unfortunate getppid() behavior on BSD-ish systems.
On MacOS X, and apparently also on other BSD-derived systems, attaching
a debugger causes getppid() to return the pid of the debugging process
rather than the actual parent PID.  As a result, debugging the
autovacuum launcher, startup process, or WAL sender on such systems
causes it to exit, because the previous coding of PostmasterIsAlive()
detects postmaster death by testing whether getppid() == PostmasterPid.

Work around that behavior by checking the return value of getppid()
more carefully.  If it's PostmasterPid, the postmaster must be alive;
if it's 1, assume the postmaster is dead.  If it's any other value,
assume we've been debugged and fall through to the less-reliable
kill() test.

Review by Tom Lane.
2010-12-21 06:30:32 -05:00
..
access Allow transactions that don't write WAL to commit asynchronously. 2010-12-20 12:59:33 -05:00
bootstrap Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
catalog Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
commands Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
executor Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
foreign Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
lib Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
libpq Make GUC variables for syslog and SSL always visible 2010-12-18 16:53:59 +01:00
main Support for collecting crash dumps on Windows 2010-12-19 16:45:28 +01:00
nodes Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
optimizer Fix up handling of simple-form CASE with constant test expression. 2010-12-19 15:30:44 -05:00
parser Generalize concept of temporary relations to "relation persistence". 2010-12-13 12:34:26 -05:00
po Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
port Remove thread dumping constant that requires newer Platform SDK 2010-12-19 21:32:58 +01:00
postmaster Remove unnecessary definition for autovacuum in SignalSomeChildren. 2010-12-17 15:59:19 -03:00
regex Fix comparisons of pointers with zero to compare with NULL instead. 2010-10-29 15:51:52 -04:00
replication Allow bidirectional copy messages in streaming replication mode. 2010-12-11 09:27:37 -05:00
rewrite Object access hook framework, with post-creation hook. 2010-11-25 11:50:13 -05:00
snowball Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
storage Work around unfortunate getppid() behavior on BSD-ish systems. 2010-12-21 06:30:32 -05:00
tcop set_ps_display when calling functions via fastpath 2010-12-17 18:51:22 -03:00
tsearch Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
utils Fix up handling of simple-form CASE with constant test expression. 2010-12-19 15:30:44 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
Makefile Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
common.mk Improved parallel make support 2010-11-12 22:15:16 +02:00
nls.mk Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00