sig_die.c
Go to the documentation of this file.
00001 #include "stdio.h"
00002 #include "signal.h"
00003 
00004 #ifndef SIGIOT
00005 #ifdef SIGABRT
00006 #define SIGIOT SIGABRT
00007 #endif
00008 #endif
00009 
00010 #ifdef KR_headers
00011 void sig_die(s, kill) char *s; int kill;
00012 #else
00013 #include "stdlib.h"
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020  extern void f_exit(void);
00021 
00022 void sig_die(const char *s, int kill)
00023 #endif
00024 {
00025         /* print error message, then clear buffers */
00026         fprintf(stderr, "%s\n", s);
00027 
00028         if(kill)
00029                 {
00030                 fflush(stderr);
00031                 f_exit();
00032                 fflush(stderr);
00033                 /* now get a core */
00034 #ifdef SIGIOT
00035                 signal(SIGIOT, SIG_DFL);
00036 #endif
00037                 abort();
00038                 }
00039         else {
00040 #ifdef NO_ONEXIT
00041                 f_exit();
00042 #endif
00043                 exit(1);
00044                 }
00045         }
00046 #ifdef __cplusplus
00047 }
00048 #endif
00049 #ifdef __cplusplus
00050 }
00051 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:09