From 1ad6646606b958bafbebb18a7c610a009d86dba2 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sat, 11 Mar 2017 20:52:19 +0100 Subject: use more descriptive -- and funny -- shutdown messages due to common system signals --- src/sys/sys_main.c | 15 +++++++++++++-- 1 file 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(); } -- cgit