In oder to exit on SIGTERM when in non-walsender code,
such as do_pg_stop_backup(), we need to set the interrupt
variables that are used there, and not just the walsender
local ones.
if (MyWalSnd)
SetLatch(&MyWalSnd->latch);
+ /*
+ * Set the standard (non-walsender) state as well, so that we can
+ * abort things like do_pg_stop_backup().
+ */
+ InterruptPending = true;
+ ProcDiePending = true;
+
errno = save_errno;
}