diff options
Diffstat (limited to 'src/backend/utils/error/assert.c')
-rw-r--r-- | src/backend/utils/error/assert.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/backend/utils/error/assert.c b/src/backend/utils/error/assert.c index eee458020d..81fe83c4b4 100644 --- a/src/backend/utils/error/assert.c +++ b/src/backend/utils/error/assert.c @@ -8,65 +8,44 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.21 2002/06/20 20:29:39 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.22 2002/08/10 20:29:18 momjian Exp $ * * NOTE - * This should eventually work with elog(), dlog(), etc. + * This should eventually work with elog() * *------------------------------------------------------------------------- */ #include "postgres.h" -#include <stdio.h> #include <unistd.h> -#include "utils/exc.h" - +/* + * ExceptionalCondition - Handles the failure of an Assert() + */ int ExceptionalCondition(char *conditionName, - Exception *exceptionP, - char *detail, + char *errorType, char *fileName, int lineNumber) { - ExcFileName = fileName; - ExcLineNumber = lineNumber; - if (!PointerIsValid(conditionName) || !PointerIsValid(fileName) - || !PointerIsValid(exceptionP)) + || !PointerIsValid(errorType)) { fprintf(stderr, "TRAP: ExceptionalCondition: bad arguments\n"); - - ExcAbort(exceptionP, - (ExcDetail) detail, - (ExcData) NULL, - (ExcMessage) NULL); } else { - fprintf(stderr, "TRAP: %s(\"%s:%s\", File: \"%s\", Line: %d)\n", - exceptionP->message, conditionName, - (detail == NULL ? "" : detail), + fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n", + errorType, conditionName, fileName, lineNumber); } -#ifdef ABORT_ON_ASSERT - abort(); -#endif #ifdef SLEEP_ON_ASSERT sleep(1000000); #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 */ + abort(); - /* XXX FIXME: detail is lost */ - ExcRaise(exceptionP, (ExcDetail) 0, (ExcData) NULL, conditionName); return 0; } |