2
===========================================================================
3
Copyright (C) 1999-2005 Id Software, Inc.
5
This file is part of Quake III Arena source code.
7
Quake III Arena source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
12
Quake III Arena source code is distributed in the hope that it will be
13
useful, 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 Quake III Arena source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
24
#include "../qcommon/q_shared.h"
25
#include "../qcommon/qcommon.h"
27
#include "../renderer/tr_local.h"
30
static qboolean signalcaught = qfalse;;
32
void Sys_Exit(int); // bk010104 - abstraction
34
static void signal_handler(int sig) // bk010104 - replace this... (NOTE TTimo huh?)
38
printf("DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n", sig);
39
Sys_Exit(1); // bk010104 - abstraction
43
printf("Received signal %d, exiting...\n", sig);
45
//GLimp_Shutdown(); // bk010104 - shouldn't this be CL_Shutdown
46
// rcg08312005 Agreed: changed to CL_Shutdown... --ryan.
49
SV_Shutdown("Signal caught");
50
Sys_Exit(0); // bk010104 - abstraction NOTE TTimo send a 0 to avoid DOUBLE SIGNAL FAULT
55
signal(SIGHUP, signal_handler);
56
signal(SIGQUIT, signal_handler);
57
signal(SIGILL, signal_handler);
58
signal(SIGTRAP, signal_handler);
59
signal(SIGIOT, signal_handler);
60
signal(SIGBUS, signal_handler);
61
signal(SIGFPE, signal_handler);
62
signal(SIGSEGV, signal_handler);
63
signal(SIGTERM, signal_handler);