USG_PG3/usr/source/sccsutil1/fatal.c

Compare this file to the similar file:
Show the results in this format:

char fatal_____[] "~|^`fatal.c:	2.3";
/*
	Routine to handle fatal errors.  Prints args on file descriptor 2.
	External "fatal_file" if non-zero should point to "current"
	file name; it is printed before each message.  Routine terminates
	by calling clean_up and exit2; user of fatal should define own
	clean_up if cleaning up is necessary on termination.
*/

char *fatal_file;

fatal(a,b,c,d)
char *a, *b, *c, *d;
{
	register int n;

/*
 *	Kludge for fatal when being called from signal
 *		(one argument which is the signal number).
 *	It should be impossible for good strings to get
 *	loaded at locations 1-3 (except, possibly, for I-D sep.)
 */
	if (a > 3) {

		n = nargs();
		if(n > 0) {
			write(2,"ERROR",5);
			if(fatal_file) {
				write(2," [",2);
				write(2,fatal_file,size(fatal_file)-1);
				write(2,"]",1);
			}
			write(2,": ",2);
			write(2,a,size(a)-1);
		}
		if(n > 1) write(2,b,size(b)-1);
		if(n > 2) write(2,c,size(c)-1);
		if(n > 3) write(2,d,size(d)-1);
		if(n > 0) write(2,"\n",1);
	}
	clean_up();
	exit2(1);
}