summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-03-11 20:52:19 +0100
committer/dev/humancontroller <devhc@example.com>2017-03-11 21:59:51 +0100
commit1ad6646606b958bafbebb18a7c610a009d86dba2 (patch)
tree3aa220cc900b1831d43b2533f407043ab2384d8f
parent34d78537d8b33801f8cb477720bd4f826f2d2829 (diff)
use more descriptive -- and funny -- shutdown messages due to common system signals
-rw-r--r--src/sys/sys_main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 8c28252e..a163b3da 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -481,12 +481,23 @@ void Sys_SigHandler( int signal )
}
else
{
+ const char *msg = NULL;
signalcaught = qtrue;
+ if( signal == SIGSEGV )
+ msg = "SIEGFAULT -- crapware detected";
+ else if( signal == SIGINT )
+ msg = "some n00b nailed the process via the console";
+ else if( signal == SIGBUS )
+ msg = "copyWROOOOONG !!!1!";
+ else if( signal == SIGTERM )
+ msg = "something pulled the rug from under the process";
+ else if( signal == SIGFPE )
+ msg = "DIVISION BY ZERO";
VM_Forced_Unload_Start();
#ifndef DEDICATED
- CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue);
+ CL_Shutdown(msg ? (char *)msg : va("Client received signal %i", signal), qtrue, qtrue);
#endif
- SV_Shutdown(va("Received signal %d", signal) );
+ SV_Shutdown(msg ? (char *)msg : va("Server received signal %i", signal));
VM_Forced_Unload_Done();
}