File: dbcertify_base_ch.c

package info (click to toggle)
fis-gtm 6.2-000-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,784 kB
  • ctags: 42,554
  • sloc: ansic: 358,483; asm: 4,847; csh: 4,574; sh: 2,261; awk: 200; makefile: 86; sed: 13
file content (99 lines) | stat: -rw-r--r-- 2,621 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/****************************************************************
 *								*
 *	Copyright 2005, 2013 Fidelity Information Services, Inc	*
 *								*
 *	This source code contains the intellectual property	*
 *	of its copyright holder(s), and is made available	*
 *	under a license.  If you do not know the terms of	*
 *	the license, please stop and do not read further.	*
 *								*
 ****************************************************************/

#include "mdef.h"

#include "gtm_stdlib.h"
#ifdef VMS
#include <descrip.h>
#endif

#include "gdsroot.h"
#include "v15_gdsroot.h"
#include "gtm_facility.h"
#include "fileinfo.h"
#include "gdsbt.h"
#include "v15_gdsbt.h"
#include "gdsblk.h"
#include "gdsfhead.h"
#include "v15_gdsfhead.h"
#include "gdsblkops.h"
#include "error.h"
#include "gtmimagename.h"
#include "filestruct.h"
#include "v15_filestruct.h"
#include "dbcertify.h"

GBLREF boolean_t		need_core;
GBLREF boolean_t		created_core;
GBLREF boolean_t		dont_want_core;
GBLREF int4            		exi_condition;
GBLREF int4            		error_condition;
GBLREF enum gtmImageTypes	image_type;

error_def(ERR_ASSERT);
error_def(ERR_GTMASSERT);
error_def(ERR_GTMASSERT2);
error_def(ERR_GTMCHECK);
error_def(ERR_MEMORY);
error_def(ERR_OUTOFSPACE);
error_def(ERR_STACKOFLOW);
error_def(ERR_VMSMEMORY);
VMS_ONLY(error_def(ERR_DBCNOFINISH);)

CONDITION_HANDLER(dbcertify_base_ch)
{
	VMS_ONLY(
		unsigned short	msglen;
		uint4		status;
		unsigned char	msginfo[4];
		unsigned char	msg_buff[MAX_MSG_SIZE + 1];
		$DESCRIPTOR(msgbuf, msg_buff);
	)

	START_CH(TRUE);
	PRN_ERROR;
	UNIX_ONLY(
		if ((DUMPABLE) && !SUPPRESS_DUMP)
		{
			need_core = TRUE;
			gtm_fork_n_core();
		}
		/* rts_error sets error_condition, and dbcertify_base_ch is called only if
		 * exiting thru rts_error. Setup exi_condition to reflect error
		 * exit status. Note, if the last eight bits (the only relevant bits
		 * for Unix exit status) of error_condition is non-zero in case of
		 * errors, we make sure that an error exit status (non-zero value -1)
		 * is setup. This is a hack.
		 */
		if (0 == exi_condition)
			exi_condition = (((error_condition & UNIX_EXIT_STATUS_MASK) != 0) ? error_condition : -1);
	)
	VMS_ONLY(
		if (SUCCESS == SEVERITY || INFO == SEVERITY)
		{
			CONTINUE;
		}
		if ((DUMPABLE) && !SUPPRESS_DUMP)
		{
			gtm_dump();
			TERMINATE;
		}
		exi_condition = SIGNAL;
		/* following is a hack to avoid FAO directives getting printed without expanding
		 * in the error message during EXIT()
		 */
		if (IS_GTM_ERROR(SIGNAL))
		        exi_condition = ERR_DBCNOFINISH;
	)
	UNSUPPORTED_PLATFORM_CHECK;
	EXIT(exi_condition);
}