diff options
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index f035a48e9b4..ed815d137c0 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2643,11 +2643,12 @@ die(SIGNAL_ARGS) InterruptHoldoffCount--; ProcessInterrupts(); } - - /* Interrupt any sync rep wait which is currently in progress. */ - SetLatch(&(MyProc->waitLatch)); } + /* If we're still here, waken anything waiting on the process latch */ + if (MyProc) + SetLatch(&MyProc->procLatch); + errno = save_errno; } @@ -2684,11 +2685,12 @@ StatementCancelHandler(SIGNAL_ARGS) InterruptHoldoffCount--; ProcessInterrupts(); } - - /* Interrupt any sync rep wait which is currently in progress. */ - SetLatch(&(MyProc->waitLatch)); } + /* If we're still here, waken anything waiting on the process latch */ + if (MyProc) + SetLatch(&MyProc->procLatch); + errno = save_errno; } @@ -2696,6 +2698,7 @@ StatementCancelHandler(SIGNAL_ARGS) void FloatExceptionHandler(SIGNAL_ARGS) { + /* We're not returning, so no need to save errno */ ereport(ERROR, (errcode(ERRCODE_FLOATING_POINT_EXCEPTION), errmsg("floating-point exception"), @@ -2708,7 +2711,13 @@ FloatExceptionHandler(SIGNAL_ARGS) static void SigHupHandler(SIGNAL_ARGS) { + int save_errno = errno; + got_SIGHUP = true; + if (MyProc) + SetLatch(&MyProc->procLatch); + + errno = save_errno; } /* |