home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************
-
- FILE
- panic.c - abort execution
-
- ROUTINES
- panic - print error message and die
-
- REMARKS
- When using interrupts on the IBM PC, one should restore interrupts
- to their default states before performing an error exit.
-
- This module assumes that the xignal package was used for interrupts
- and uses a xignal() call to restore all affected interrupts before
- terminating.
-
- LAST UPDATE
- 25 January 1988
- calls setalarm() also
-
- Copyright(c) 1985-1988 D.M. Auslander and C.H. Tham
-
- ***********************************************************************/
-
- #include "envir.h"
- #include "xignal.h"
- #include "alarm.h"
-
-
- void panic(mesg)
- char *mesg;
- {
-
- xignal(XIGALL, XIG_IGN); /* ignore all signals */
-
- printf("\nABORT - %s\n\n\07", mesg); /* print error message */
-
- xignal(XIGALL, XIG_DFL); /* restore defaults */
-
- setalarm(-1.0); /* restore clock */
-
- }
-
-