| 1 |
#include "stdio.h" |
| 2 |
#include "signal.h" |
| 3 |
|
| 4 |
#ifndef SIGIOT |
| 5 |
#ifdef SIGABRT |
| 6 |
#define SIGIOT SIGABRT |
| 7 |
#endif |
| 8 |
#endif |
| 9 |
|
| 10 |
#ifdef KR_headers |
| 11 |
void sig_die(s, kill) register char *s; int kill; |
| 12 |
#else |
| 13 |
#include "stdlib.h" |
| 14 |
#ifdef __cplusplus |
| 15 |
extern "C" { |
| 16 |
#endif |
| 17 |
#ifdef __cplusplus |
| 18 |
extern "C" { |
| 19 |
#endif |
| 20 |
extern void f_exit(void); |
| 21 |
|
| 22 |
void sig_die(register char *s, int kill) |
| 23 |
#endif |
| 24 |
{ |
| 25 |
/* print error message, then clear buffers */ |
| 26 |
fprintf(stderr, "%s\n", s); |
| 27 |
|
| 28 |
if(kill) |
| 29 |
{ |
| 30 |
fflush(stderr); |
| 31 |
f_exit(); |
| 32 |
fflush(stderr); |
| 33 |
/* now get a core */ |
| 34 |
#ifdef SIGIOT |
| 35 |
signal(SIGIOT, SIG_DFL); |
| 36 |
#endif |
| 37 |
abort(); |
| 38 |
} |
| 39 |
else { |
| 40 |
#ifdef NO_ONEXIT |
| 41 |
f_exit(); |
| 42 |
#endif |
| 43 |
exit(1); |
| 44 |
} |
| 45 |
} |
| 46 |
#ifdef __cplusplus |
| 47 |
} |
| 48 |
#endif |
| 49 |
#ifdef __cplusplus |
| 50 |
} |
| 51 |
#endif |