- Notifications
You must be signed in to change notification settings - Fork5
Commit24ecde7
committed
Work around unfortunate getppid() behavior on BSD-ish systems.
On MacOS X, and apparently also on other BSD-derived systems, attachinga debugger causes getppid() to return the pid of the debugging processrather than the actual parent PID. As a result, debugging theautovacuum launcher, startup process, or WAL sender on such systemscauses 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-reliablekill() test.Review by Tom Lane.1 parentf6a0863 commit24ecde7
1 file changed
+21
-13
lines changedLines changed: 21 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
263 | 273 |
| |
264 |
| - | |
265 |
| - | |
266 |
| - | |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 |
| - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
276 | 277 |
| |
277 |
| - | |
278 | 278 |
| |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
279 | 287 |
| |
280 | 288 |
| |
281 | 289 |
| |
|
0 commit comments
Comments
(0)