diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 1999-04-16 06:38:17 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 1999-04-16 06:38:17 +0000 |
commit | 075dc252c7b887f1f5871b2c96d8f6ddf869bda2 (patch) | |
tree | 067e541926e90de6e8e0cdbdacdafb22420e88e9 /src | |
parent | e062a176a8fbbb61a4bd188b78c46e950adb8111 (diff) | |
download | postgresql-075dc252c7b887f1f5871b2c96d8f6ddf869bda2.tar.gz postgresql-075dc252c7b887f1f5871b2c96d8f6ddf869bda2.zip |
Fix kill() call in elog() so that it gets its own pid by calling getpid().
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/error/elog.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 5909bedec05..3704f457f82 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.39 1999/02/13 23:19:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.40 1999/04/16 06:38:17 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -221,7 +221,11 @@ elog(int lev, const char *fmt,...) 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(); } |