gcc/libf2c/libF77/sig_die.c
Kaveh R. Ghazi 9321813126 F77_aloc.c, [...]: Delete checks on __cplusplus.
* libF77/F77_aloc.c, libF77/exit_.c, libF77/main.c,
	libF77/s_paus.c, libF77/s_stop.c, libF77/setarg.c,
	libF77/setsig.c, libF77/sig_die.c, libF77/signal1.h0,
	libI77/close.c, libI77/dolio.c, libI77/fio.h, libI77/fmt.h,
	libI77/lio.h: Delete checks on __cplusplus.

From-SVN: r54133
2002-06-01 01:55:57 +00:00

36 lines
486 B
C

#include <stdio.h>
#include <signal.h>
#ifndef SIGIOT
#ifdef SIGABRT
#define SIGIOT SIGABRT
#endif
#endif
#include <stdlib.h>
extern void f_exit(void);
void sig_die(register char *s, int kill)
{
/* print error message, then clear buffers */
fprintf(stderr, "%s\n", s);
if(kill)
{
fflush(stderr);
f_exit();
fflush(stderr);
/* now get a core */
#ifdef SIGIOT
signal(SIGIOT, SIG_DFL);
#endif
abort();
}
else {
#ifdef NO_ONEXIT
f_exit();
#endif
exit(1);
}
}