aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-06 17:25:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-06 17:25:46 +0000
commit5fb1022212bad45e82177dbdaacb6dfc02bb70c6 (patch)
tree107add80bccaf7a3be7fda374193e6e64e956375 /src
parenta0f863637f15c7f64b9a94cdcb767da27b489399 (diff)
downloadpostgresql-5fb1022212bad45e82177dbdaacb6dfc02bb70c6.tar.gz
postgresql-5fb1022212bad45e82177dbdaacb6dfc02bb70c6.zip
Don't include miscadmin.h in elog.h, since the former is not part of
the installed header file set.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/error/elog.c3
-rw-r--r--src/include/utils/elog.h40
2 files changed, 24 insertions, 19 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index b3fbd4b19e4..cb56f33c83c 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -8,7 +8,7 @@
*
*
* 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 @@
#include "commands/copy.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
+#include "miscadmin.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/memutils.h"
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index ad1643b6908..acb82049730 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -7,15 +7,13 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* 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
#define ELOG_H
-#include "miscadmin.h"
-
#define NOTICE 0 /* random info - no special action */
#define ERROR (-1) /* user error - return to known state */
#define FATAL 1 /* fatal error - abort process */
@@ -30,23 +28,29 @@ extern int Use_syslog;
#endif
/*
- * If StopIfError > 0 signal handlers don't do
- * elog(ERROR|FATAL) but remember what action was
- * required with QueryCancel & ExitAfterAbort
+ * If StopIfError > 0 signal handlers mustn't do
+ * elog(ERROR|FATAL), instead remember what action is
+ * required with QueryCancel & ExitAfterAbort.
*/
+extern uint32 StopIfError; /* duplicates access/xlog.h */
+extern bool QueryCancel; /* duplicates miscadmin.h */
extern bool ExitAfterAbort;
-#define START_CRIT_CODE StopIfError++
-#define END_CRIT_CODE \
- if (!StopIfError)\
- elog(STOP, "Not in critical section");\
- StopIfError--;\
- if (!StopIfError && QueryCancel)\
- {\
- if (ExitAfterAbort)\
- elog(FATAL, "The system is shutting down");\
- else\
- elog(ERROR, "Query was cancelled.");\
- }
+
+#define START_CRIT_CODE (StopIfError++)
+
+#define END_CRIT_CODE \
+ do { \
+ if (!StopIfError) \
+ elog(STOP, "Not in critical section"); \
+ StopIfError--; \
+ if (!StopIfError && QueryCancel) \
+ { \
+ if (ExitAfterAbort) \
+ elog(FATAL, "The system is shutting down"); \
+ else \
+ elog(ERROR, "Query was cancelled."); \
+ } \
+ } while(0)
extern bool Log_timestamp;
extern bool Log_pid;