MyProcPid global variable is set to 0 when postgres starts as a command
(not as a backend daemon). This leads issuing SIGQUIT to the process group,
not the process itself. As a result, parent sh gets core dumped in the
Wisconsin benchmark test.
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
if (!InError)
{
- kill(MyProcPid, SIGQUIT); /* abort to traffic cop */
+ if (MyProcPid == 0) {
+ kill(getpid(), SIGQUIT);
+ } else {
+ kill(MyProcPid, SIGQUIT); /* abort to traffic cop */
+ }
pause();
}