Commit 5fb10222 authored by Tom Lane's avatar Tom Lane

Don't include miscadmin.h in elog.h, since the former is not part of

the installed header file set.
parent a0f86363
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.72 2000/12/03 20:45:36 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.73 2000/12/06 17:25:46 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "commands/copy.h" #include "commands/copy.h"
#include "libpq/libpq.h" #include "libpq/libpq.h"
#include "libpq/pqformat.h" #include "libpq/pqformat.h"
#include "miscadmin.h"
#include "storage/proc.h" #include "storage/proc.h"
#include "tcop/tcopprot.h" #include "tcop/tcopprot.h"
#include "utils/memutils.h" #include "utils/memutils.h"
......
...@@ -7,15 +7,13 @@ ...@@ -7,15 +7,13 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: elog.h,v 1.19 2000/12/03 10:27:29 vadim Exp $ * $Id: elog.h,v 1.20 2000/12/06 17:25:45 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#ifndef ELOG_H #ifndef ELOG_H
#define ELOG_H #define ELOG_H
#include "miscadmin.h"
#define NOTICE 0 /* random info - no special action */ #define NOTICE 0 /* random info - no special action */
#define ERROR (-1) /* user error - return to known state */ #define ERROR (-1) /* user error - return to known state */
#define FATAL 1 /* fatal error - abort process */ #define FATAL 1 /* fatal error - abort process */
...@@ -30,23 +28,29 @@ extern int Use_syslog; ...@@ -30,23 +28,29 @@ extern int Use_syslog;
#endif #endif
/* /*
* If StopIfError > 0 signal handlers don't do * If StopIfError > 0 signal handlers mustn't do
* elog(ERROR|FATAL) but remember what action was * elog(ERROR|FATAL), instead remember what action is
* required with QueryCancel & ExitAfterAbort * required with QueryCancel & ExitAfterAbort.
*/ */
extern uint32 StopIfError; /* duplicates access/xlog.h */
extern bool QueryCancel; /* duplicates miscadmin.h */
extern bool ExitAfterAbort; extern bool ExitAfterAbort;
#define START_CRIT_CODE StopIfError++
#define END_CRIT_CODE \ #define START_CRIT_CODE (StopIfError++)
if (!StopIfError)\
elog(STOP, "Not in critical section");\ #define END_CRIT_CODE \
StopIfError--;\ do { \
if (!StopIfError && QueryCancel)\ if (!StopIfError) \
{\ elog(STOP, "Not in critical section"); \
if (ExitAfterAbort)\ StopIfError--; \
elog(FATAL, "The system is shutting down");\ if (!StopIfError && QueryCancel) \
else\ { \
elog(ERROR, "Query was cancelled.");\ if (ExitAfterAbort) \
} elog(FATAL, "The system is shutting down"); \
else \
elog(ERROR, "Query was cancelled."); \
} \
} while(0)
extern bool Log_timestamp; extern bool Log_timestamp;
extern bool Log_pid; extern bool Log_pid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment