aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/error/assert.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/error/assert.c')
-rw-r--r--src/backend/utils/error/assert.c86
1 files changed, 45 insertions, 41 deletions
diff --git a/src/backend/utils/error/assert.c b/src/backend/utils/error/assert.c
index 4fb99ced1b9..2c46dde02b8 100644
--- a/src/backend/utils/error/assert.c
+++ b/src/backend/utils/error/assert.c
@@ -1,67 +1,71 @@
/*-------------------------------------------------------------------------
*
* assert.c--
- * Assert code.
+ * Assert code.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.4 1997/04/17 20:38:26 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.5 1997/09/07 04:53:11 momjian Exp $
*
* NOTE
- * This should eventually work with elog(), dlog(), etc.
+ * This should eventually work with elog(), dlog(), etc.
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
-#include "postgres.h" /* where the declaration goes */
+#include "postgres.h" /* where the declaration goes */
#include "utils/module.h"
#include "utils/exc.h"
int
-ExceptionalCondition(char* conditionName,
- Exception *exceptionP,
- char* detail,
- char* fileName,
- int lineNumber)
+ExceptionalCondition(char *conditionName,
+ Exception * exceptionP,
+ char *detail,
+ char *fileName,
+ int lineNumber)
{
- extern char* ExcFileName; /* XXX */
- extern Index ExcLineNumber; /* XXX */
-
- ExcFileName = fileName;
- ExcLineNumber = lineNumber;
-
- if (!PointerIsValid(conditionName)
- || !PointerIsValid(fileName)
- || !PointerIsValid(exceptionP)) {
- fprintf(stderr, "ExceptionalCondition: bad arguments\n");
-
- ExcAbort(exceptionP,
- (ExcDetail)detail,
- (ExcData)NULL,
- (ExcMessage)NULL);
- } else {
- fprintf(stderr,
- "%s(\"%s:%s\", File: \"%s\", Line: %d)\n",
+ extern char *ExcFileName;/* XXX */
+ extern Index ExcLineNumber; /* XXX */
+
+ ExcFileName = fileName;
+ ExcLineNumber = lineNumber;
+
+ if (!PointerIsValid(conditionName)
+ || !PointerIsValid(fileName)
+ || !PointerIsValid(exceptionP))
+ {
+ fprintf(stderr, "ExceptionalCondition: bad arguments\n");
+
+ ExcAbort(exceptionP,
+ (ExcDetail) detail,
+ (ExcData) NULL,
+ (ExcMessage) NULL);
+ }
+ else
+ {
+ fprintf(stderr,
+ "%s(\"%s:%s\", File: \"%s\", Line: %d)\n",
exceptionP->message, conditionName, detail == NULL ? "" : detail,
- fileName, lineNumber);
- }
+ fileName, lineNumber);
+ }
#ifdef ABORT_ON_ASSERT
- abort();
+ abort();
#endif
- /*
- * XXX Depending on the Exception and tracing conditions, you will
- * XXX want to stop here immediately and maybe dump core.
- * XXX This may be especially true for Assert(), etc.
- */
-
- /* TraceDump(); dump the trace stack */
-
- /* XXX FIXME: detail is lost */
- ExcRaise(exceptionP, (ExcDetail)0, (ExcData)NULL, conditionName);
- return(0);
+
+ /*
+ * XXX Depending on the Exception and tracing conditions, you will XXX
+ * want to stop here immediately and maybe dump core. XXX This may be
+ * especially true for Assert(), etc.
+ */
+
+ /* TraceDump(); dump the trace stack */
+
+ /* XXX FIXME: detail is lost */
+ ExcRaise(exceptionP, (ExcDetail) 0, (ExcData) NULL, conditionName);
+ return (0);
}