Merge from vendor branch OPENSSL:
[dragonfly.git] / contrib / gcc-3.4 / 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 extern void f_exit (void);
12
13 void
14 sig_die (register char *s, int kill)
15 {
16   /* print error message, then clear buffers */
17   fprintf (stderr, "%s\n", s);
18
19   if (kill)
20     {
21       fflush (stderr);
22       f_exit ();
23       fflush (stderr);
24       /* now get a core */
25 #ifdef SIGIOT
26       signal (SIGIOT, SIG_DFL);
27 #endif
28       abort ();
29     }
30   else
31     {
32 #ifdef NO_ONEXIT
33       f_exit ();
34 #endif
35       exit (1);
36     }
37 }