/* Copyright © Oracle Corporation 1995. All Rights Reserved. */ /**************************************************************************** * This routine is called to abort a distributed transaction. It expects * 2 parameters: the context structure and the error code. * *****************************************************************************/ #include #include #include #include EXEC SQL INCLUDE SQLCA; struct context_struct { long version; long type; long length; long distributed_tid[4]; long end; }; extern long sqlcode; extern void LIB$SIGNAL(long status); sql$dist_trans_error (struct context_struct *context) { int status; short iosb[4]; struct context_struct local_context; local_context = *context; sys$putmsg(&RDB$MESSAGE_VECTOR,0,0,0); iosb[0] = 0; status = sys$abort_transw( 0, /*efn */ 0, /*flags */ iosb,/*IO status block */ 0, /*astadr */ 0, /*astprm */ & (local_context.distributed_tid)); if (status != SS$_SYNCH) status = iosb[0]; if ((status & 1) == 0) LIB$SIGNAL(status); return; }