このページを編集する際は、編集に関する方針に従ってください。

概要

* ExceptionalCondition - Handles the failure of an Assert()

引数

実装

	int
	ExceptionalCondition(char *conditionName,
						 char *errorType,
						 char *fileName,
						 int lineNumber)
	{
		fprintf(stderr, "TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n",
				errorType, conditionName,
				fileName, lineNumber);
		abort();
		return 0;
	}
	int
	ExceptionalCondition(char *conditionName,
						 char *errorType,
						 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);
		}
	
	#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;
	}

呼出元

履歴

コメント



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS