2001-08-03 Daniel Berlin <dan@cgsoftware.com>
[official-gcc.git] / libf2c / libF77 / sig_die.c
blobbebb1e7b8f783d0921442b10d2c44a162c41acda
1 #include <stdio.h>
2 #include <signal.h>
4 #ifndef SIGIOT
5 #ifdef SIGABRT
6 #define SIGIOT SIGABRT
7 #endif
8 #endif
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 extern void f_exit(void);
19 void sig_die(register char *s, int kill)
20 #endif
22 /* print error message, then clear buffers */
23 fprintf(stderr, "%s\n", s);
25 if(kill)
27 fflush(stderr);
28 f_exit();
29 fflush(stderr);
30 /* now get a core */
31 #ifdef SIGIOT
32 signal(SIGIOT, SIG_DFL);
33 #endif
34 abort();
36 else {
37 #ifdef NO_ONEXIT
38 f_exit();
39 #endif
40 exit(1);
43 #ifdef __cplusplus
45 #endif