2 Unix SMB/Netbios implementation.
4 Critical Fault handling
5 Copyright (C) Andrew Tridgell 1992-1998
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 static void (*cont_fn
)(void *);
27 /*******************************************************************
29 ********************************************************************/
30 static void fault_report(int sig
)
34 if (counter
) _exit(1);
38 DEBUG(0,("===============================================================\n"));
39 DEBUG(0,("INTERNAL ERROR: Signal %d in pid %d (%s)",sig
,(int)sys_getpid(),VERSION
));
40 DEBUG(0,("\nPlease read the file BUGS.txt in the distribution\n"));
41 DEBUG(0,("===============================================================\n"));
43 smb_panic("internal error");
48 CatchSignal(SIGSEGV
,SIGNAL_CAST SIG_DFL
);
51 CatchSignal(SIGBUS
,SIGNAL_CAST SIG_DFL
);
53 return; /* this should cause a core dump */
58 /****************************************************************************
60 ****************************************************************************/
61 static void sig_fault(int sig
)
66 /*******************************************************************
67 setup our fault handlers
68 ********************************************************************/
69 void fault_setup(void (*fn
)(void *))
74 CatchSignal(SIGSEGV
,SIGNAL_CAST sig_fault
);
77 CatchSignal(SIGBUS
,SIGNAL_CAST sig_fault
);