Exemple #1
0
/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
	static qboolean signalcaught = qfalse;

	//Com_Printf("signal: %d\n", signal);
	if( signalcaught )
	{
		fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
			signal );
	}
	else
	{
		signalcaught = qtrue;
		VM_Forced_Unload_Start();
		fprintf( stderr, "Received signal %d, exiting...\n", signal );

#ifndef DEDICATED
		CL_Shutdown();
#endif
		SV_Shutdown( "Signal caught" );
		VM_Forced_Unload_Done();
	}

	Sys_Exit( 0 ); // Exit with 0 to avoid recursive signals
}
/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal )
{
	static qboolean signalcaught = qfalse;

	if( signalcaught )
	{
		fprintf( stderr, "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n",
			signal );
	}
	else
	{
		signalcaught = qtrue;
		VM_Forced_Unload_Start();
#ifndef DEDICATED
		CL_Shutdown(va("Received signal %d", signal), qtrue, qtrue);
#endif
		SV_Shutdown(va("Received signal %d", signal) );
		VM_Forced_Unload_Done();
	}

	if( signal == SIGTERM || signal == SIGINT )
		Sys_Exit( 1 );
	else
		Sys_Exit( 2 );
}
Exemple #3
0
/*
=================
Sys_SigHandler
=================
*/
void Sys_SigHandler( int signal ) {
	static qboolean signalcaught = qfalse;

	if( signalcaught ) {
		VM_Forced_Unload_Start();
		Com_Printf("DOUBLE SIGNAL FAULT: Received signal %d: \"%s\", exiting...\n", signal, SignalToString(signal));
		exit(1);
	} else {
		signalcaught = qtrue;
#ifndef DEDICATED
		CL_Shutdown( );
#endif
		SV_Shutdown( va( "Received signal %d", signal ) );
		VM_Forced_Unload_Done();
	}

	if( signal == SIGTERM || signal == SIGINT ) {
		Sys_Exit( 1 );
	} else {
		Sys_Exit( 2 );
	}
}