summaryrefslogtreecommitdiff
path: root/src/backend/replication/walreceiver.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-10 12:20:45 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-10 12:20:45 -0400
commit989f530d3f793ed1c990d705d0958bfd2a533b85 (patch)
treea6676b9e587c9caf40b0e8dfd99bbd6bab4dd35f /src/backend/replication/walreceiver.c
parent74d099494c5853a44188316ba117a8909b299d40 (diff)
Back-patch assorted latch-related fixes.
Fix a whole bunch of signal handlers that had been hacked to do things that might change errno, without adding the necessary save/restore logic for errno. Also make some minor fixes in unix_latch.c, and clean up bizarre and unsafe scheme for disowning the process's latch. While at it, rename the PGPROC latch field to procLatch for consistency with 9.2. Issues noted while reviewing a patch by Peter Geoghegan.
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r--src/backend/replication/walreceiver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c
index 471c844ab2a..18b4727fa81 100644
--- a/src/backend/replication/walreceiver.c
+++ b/src/backend/replication/walreceiver.c
@@ -373,11 +373,15 @@ WalRcvSigHupHandler(SIGNAL_ARGS)
static void
WalRcvShutdownHandler(SIGNAL_ARGS)
{
+ int save_errno = errno;
+
got_SIGTERM = true;
/* Don't joggle the elbow of proc_exit */
if (!proc_exit_inprogress && WalRcvImmediateInterruptOK)
ProcessWalRcvInterrupts();
+
+ errno = save_errno;
}
/*