1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00
This is a patch to prevent an endless loop occuring in the Postgres backend
when a 'warning' error condition generates another warning error contition
in the handler code.

Submitted by: Chris Dunlop, <chris@onthe.net.au>
This commit is contained in:
Marc G. Fournier
1996-07-19 06:13:58 +00:00
parent 64bfa0487b
commit 9bffaade96
2 changed files with 12 additions and 6 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.2 1996/07/16 07:13:47 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.3 1996/07/19 06:13:58 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -150,13 +150,16 @@ elog(int lev, char *fmt, ... )
#endif /* !PG_STANDALONE */
if (lev == WARN) {
extern int InWarn;
ProcReleaseSpins(NULL); /* get rid of spinlocks we hold */
if (!InWarn) {
#ifndef WIN32
kill(getpid(), 1); /* abort to traffic cop */
pause();
kill(getpid(), 1); /* abort to traffic cop */
pause();
#else
longjmp(Warn_restart, 1);
longjmp(Warn_restart, 1);
#endif /* WIN32 */
}
/*
* The pause(3) is just to avoid race conditions where the
* thread of control on an MP system gets past here (i.e.,