assert.c

来自「postgresql8.3.4源码,开源数据库」· C语言 代码 · 共 61 行

C
61
字号
/*------------------------------------------------------------------------- * * assert.c *	  Assert code. * * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION *	  $PostgreSQL: pgsql/src/backend/utils/error/assert.c,v 1.35 2008/01/01 19:45:53 momjian Exp $ * * NOTE *	  This should eventually work with elog() * *------------------------------------------------------------------------- */#include "postgres.h"#include <unistd.h>/* * ExceptionalCondition - Handles the failure of an Assert() * * Note: this can't actually return, but we declare it as returning int * because the TrapMacro() macro might get wonky otherwise. */intExceptionalCondition(const char *conditionName,					 const char *errorType,					 const char *fileName,					 int lineNumber){	if (!PointerIsValid(conditionName)		|| !PointerIsValid(fileName)		|| !PointerIsValid(errorType))		write_stderr("TRAP: ExceptionalCondition: bad arguments\n");	else	{		write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n",					 errorType, conditionName,					 fileName, lineNumber);	}	/* Usually this shouldn't be needed, but make sure the msg went out */	fflush(stderr);#ifdef SLEEP_ON_ASSERT	/*	 * It would be nice to use pg_usleep() here, but only does 2000 sec or 33	 * minutes, which seems too short.	 */	sleep(1000000);#endif	abort();	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?