summaryrefslogtreecommitdiff
path: root/source/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-08-30 12:56:30 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-08-30 12:56:30 +0000
commit981120da68b03ac04eda15f1898dbc6c1fea5351 (patch)
treeaebf32bc14a191f22aa66dc767264b88da225356 /source/sys_unix.c
parent359558ac4bc6fb496a764f779491c252401ad72a (diff)
Output number of active players along with number of spectators in
the Channel Chooser menu. Unknown commands from GTV spectators are now handled as chat. It is up to GTV admin to block mod-specific commands which spectators usually have bound to keyboard via `addfiltercmd' facility. Added `sys_parachute' cvar (default 1) which allows one to disable fatal signal handlers on Unix for automatic core dump creation purpose. Build all binaries with debugging symbols included by default.
Diffstat (limited to 'source/sys_unix.c')
-rw-r--r--source/sys_unix.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/sys_unix.c b/source/sys_unix.c
index 9f71eab..0798c96 100644
--- a/source/sys_unix.c
+++ b/source/sys_unix.c
@@ -58,6 +58,7 @@ cvar_t *sys_basedir;
cvar_t *sys_libdir;
cvar_t *sys_homedir;
cvar_t *sys_stdio;
+cvar_t *sys_parachute;
static qboolean tty_enabled;
static struct termios tty_orig;
@@ -656,10 +657,6 @@ void Sys_Init( void ) {
signal( SIGTERM, Sys_Term );
signal( SIGINT, Sys_Term );
- signal( SIGSEGV, Sys_Kill );
- signal( SIGILL, Sys_Kill );
- signal( SIGFPE, Sys_Kill );
- signal( SIGTRAP, Sys_Kill );
signal( SIGTTIN, SIG_IGN );
signal( SIGTTOU, SIG_IGN );
@@ -683,8 +680,9 @@ void Sys_Init( void ) {
sys_libdir = Cvar_Get( "libdir", LIBDIR, CVAR_NOSET );
sys_stdio = Cvar_Get( "sys_stdio", "2", CVAR_NOSET );
+ sys_parachute = Cvar_Get( "sys_parachute", "1", CVAR_NOSET );
- if( sys_stdio->integer ) {
+ if( sys_stdio->integer > 0 ) {
// change stdin to non-blocking and stdout to blocking
fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | FNDELAY );
fcntl( 1, F_SETFL, fcntl( 1, F_GETFL, 0 ) & ~FNDELAY );
@@ -703,6 +701,14 @@ void Sys_Init( void ) {
signal( SIGHUP, SIG_IGN );
}
+ if( sys_parachute->integer ) {
+ // perform some cleanup when crashing
+ signal( SIGSEGV, Sys_Kill );
+ signal( SIGILL, Sys_Kill );
+ signal( SIGFPE, Sys_Kill );
+ signal( SIGTRAP, Sys_Kill );
+ }
+
Sys_FixFPCW();
}