OSDN Git Service

* libF77/*: Delete KR_headers cruft.
[pf3gnuchains/gcc-fork.git] / libf2c / libF77 / sig_die.c
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 #include <stdlib.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14  extern void f_exit(void);
15
16 void sig_die(register char *s, int kill)
17 {
18         /* print error message, then clear buffers */
19         fprintf(stderr, "%s\n", s);
20
21         if(kill)
22                 {
23                 fflush(stderr);
24                 f_exit();
25                 fflush(stderr);
26                 /* now get a core */
27 #ifdef SIGIOT
28                 signal(SIGIOT, SIG_DFL);
29 #endif
30                 abort();
31                 }
32         else {
33 #ifdef NO_ONEXIT
34                 f_exit();
35 #endif
36                 exit(1);
37                 }
38         }
39 #ifdef __cplusplus
40 }
41 #endif