1998-02-01 02:37:08 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
#ifndef SIGIOT
|
|
|
|
#ifdef SIGABRT
|
|
|
|
#define SIGIOT SIGABRT
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
2002-06-01 14:38:32 +02:00
|
|
|
extern void f_exit (void);
|
1998-02-01 02:37:08 +01:00
|
|
|
|
2002-06-01 14:38:32 +02:00
|
|
|
void
|
|
|
|
sig_die (register char *s, int kill)
|
1998-02-01 02:37:08 +01:00
|
|
|
{
|
2002-06-01 14:38:32 +02:00
|
|
|
/* print error message, then clear buffers */
|
|
|
|
fprintf (stderr, "%s\n", s);
|
1998-02-01 02:37:08 +01:00
|
|
|
|
2002-06-01 14:38:32 +02:00
|
|
|
if (kill)
|
|
|
|
{
|
|
|
|
fflush (stderr);
|
|
|
|
f_exit ();
|
|
|
|
fflush (stderr);
|
|
|
|
/* now get a core */
|
1998-02-01 02:37:08 +01:00
|
|
|
#ifdef SIGIOT
|
2002-06-01 14:38:32 +02:00
|
|
|
signal (SIGIOT, SIG_DFL);
|
1998-02-01 02:37:08 +01:00
|
|
|
#endif
|
2002-06-01 14:38:32 +02:00
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-02-01 02:37:08 +01:00
|
|
|
#ifdef NO_ONEXIT
|
2002-06-01 14:38:32 +02:00
|
|
|
f_exit ();
|
1998-02-01 02:37:08 +01:00
|
|
|
#endif
|
2002-06-01 14:38:32 +02:00
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|