* Shutdown signal from postmaster: abort transaction and exit * at soonest convenient time */
| 3790 | * at soonest convenient time |
| 3791 | */ |
| 3792 | void |
| 3793 | die(SIGNAL_ARGS) |
| 3794 | { |
| 3795 | int save_errno = errno; |
| 3796 | |
| 3797 | /* Don't joggle the elbow of proc_exit */ |
| 3798 | if (!proc_exit_inprogress) |
| 3799 | { |
| 3800 | InterruptPending = true; |
| 3801 | ProcDiePending = true; |
| 3802 | } |
| 3803 | |
| 3804 | /* for the statistics collector */ |
| 3805 | pgStatSessionEndCause = DISCONNECT_KILLED; |
| 3806 | |
| 3807 | /* If we're still here, waken anything waiting on the process latch */ |
| 3808 | SetLatch(MyLatch); |
| 3809 | |
| 3810 | /* |
| 3811 | * If we're in single user mode, we want to quit immediately - we can't |
| 3812 | * rely on latches as they wouldn't work when stdin/stdout is a file. |
| 3813 | * Rather ugly, but it's unlikely to be worthwhile to invest much more |
| 3814 | * effort just for the benefit of single user mode. |
| 3815 | */ |
| 3816 | if (DoingCommandRead && whereToSendOutput != DestRemote) |
| 3817 | ProcessInterrupts(__FILE__, __LINE__); |
| 3818 | |
| 3819 | errno = save_errno; |
| 3820 | } |
| 3821 | |
| 3822 | /* |
| 3823 | * Query-cancel signal from postmaster: abort current transaction |