
/* _abort.c - default signal handler, print an apropriate error message
   and exit() with failed return status. (ryb) */

#include <libraries/dos.h>
#include <functions.h>
#include <stdlib.h>
#include <signal.h>

#define BREAK_MESSAGE "***Break\n"

/* Print a `***Break'-like message. */
#define ABORT_MESSAGE "***Abort\n"

int raise ();

void _abort (int sig)
{
  switch (sig)
    {
    case SIGINT:
      Write (Output (), BREAK_MESSAGE, sizeof (BREAK_MESSAGE) - 1);
      break;
    case SIGABRT:
    default:
      Write (Output (), ABORT_MESSAGE, sizeof (ABORT_MESSAGE) - 1);
      break;
    }
  exit (EXIT_FAILURE);
}
