mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-17 09:42:36 +00:00
Get rid of the SIGFPE handler
If shit happens, let it crash.
This commit is contained in:
parent
9cbc9ff6db
commit
b073f281ad
4 changed files with 1 additions and 61 deletions
|
@ -120,16 +120,6 @@ void Sys_Shutdown( void ) {
|
||||||
Posix_Shutdown();
|
Posix_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
Sys_FPE_handler
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void Sys_FPE_handler( int signum, siginfo_t *info, void *context ) {
|
|
||||||
assert( signum == SIGFPE );
|
|
||||||
Sys_Printf( "FPE\n" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
Sys_GetSystemRam
|
Sys_GetSystemRam
|
||||||
|
|
|
@ -79,47 +79,6 @@ void Sys_Shutdown( void ) {
|
||||||
Posix_Shutdown();
|
Posix_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
Sys_FPE_handler
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void Sys_FPE_handler( int signum, siginfo_t *info, void *context ) {
|
|
||||||
#if defined(__ppc__)
|
|
||||||
int ret;
|
|
||||||
ppc_float_state_t *fs;
|
|
||||||
ppc_thread_state_t *ss;
|
|
||||||
|
|
||||||
fs = &( (struct ucontext *)context )->uc_mcontext->fs;
|
|
||||||
ss = &( (struct ucontext *)context )->uc_mcontext->ss;
|
|
||||||
|
|
||||||
Sys_Printf( "FPE at 0x%x:\n", info->si_addr );
|
|
||||||
|
|
||||||
ret = fetestexcept( FE_ALL_EXCEPT );
|
|
||||||
if ( ret & FE_INEXACT ) {
|
|
||||||
Sys_Printf( "FE_INEXACT " );
|
|
||||||
}
|
|
||||||
if ( ret & FE_DIVBYZERO ) {
|
|
||||||
Sys_Printf( "FE_DIVBYZERO " );
|
|
||||||
}
|
|
||||||
if ( ret & FE_UNDERFLOW ) {
|
|
||||||
Sys_Printf( "FE_UNDERFLOW " );
|
|
||||||
}
|
|
||||||
if ( ret & FE_OVERFLOW ) {
|
|
||||||
Sys_Printf( "FE_OVERFLOW " );
|
|
||||||
}
|
|
||||||
if ( ret & FE_INVALID ) {
|
|
||||||
Sys_Printf( "FE_INVALID " );
|
|
||||||
}
|
|
||||||
Sys_Printf( "\n" );
|
|
||||||
// clear the exception flags
|
|
||||||
feclearexcept( FE_ALL_EXCEPT );
|
|
||||||
// re-arm
|
|
||||||
fs->fpscr &= exception_mask;
|
|
||||||
ss->srr0 += 4;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
Sys_GetSystemRam
|
Sys_GetSystemRam
|
||||||
|
|
|
@ -50,7 +50,6 @@ void Posix_SetExitSpawn( const char *exeName ); // set the process to be spawne
|
||||||
void Posix_InitConsoleInput( void );
|
void Posix_InitConsoleInput( void );
|
||||||
void Posix_Shutdown( void );
|
void Posix_Shutdown( void );
|
||||||
|
|
||||||
void Sys_FPE_handler( int signum, siginfo_t *info, void *context );
|
|
||||||
void Sys_DoStartProcess( const char *exeName, bool dofork = true ); // if not forking, current process gets replaced
|
void Sys_DoStartProcess( const char *exeName, bool dofork = true ); // if not forking, current process gets replaced
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -42,7 +42,6 @@ const int siglist[] = {
|
||||||
SIGTRAP,
|
SIGTRAP,
|
||||||
SIGIOT,
|
SIGIOT,
|
||||||
SIGBUS,
|
SIGBUS,
|
||||||
SIGFPE,
|
|
||||||
SIGSEGV,
|
SIGSEGV,
|
||||||
SIGPIPE,
|
SIGPIPE,
|
||||||
SIGABRT,
|
SIGABRT,
|
||||||
|
@ -58,7 +57,6 @@ const char *signames[] = {
|
||||||
"SIGTRAP",
|
"SIGTRAP",
|
||||||
"SIGIOT",
|
"SIGIOT",
|
||||||
"SIGBUS",
|
"SIGBUS",
|
||||||
"SIGFPE",
|
|
||||||
"SIGSEGV",
|
"SIGSEGV",
|
||||||
"SIGPIPE",
|
"SIGPIPE",
|
||||||
"SIGABRT",
|
"SIGABRT",
|
||||||
|
@ -138,13 +136,7 @@ void Posix_InitSigs( ) {
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ( siglist[ i ] != -1 ) {
|
while ( siglist[ i ] != -1 ) {
|
||||||
if ( siglist[ i ] == SIGFPE ) {
|
if ( sigaction( siglist[ i ], &action, NULL ) != 0 ) {
|
||||||
action.sa_sigaction = Sys_FPE_handler;
|
|
||||||
if ( sigaction( siglist[ i ], &action, NULL ) != 0 ) {
|
|
||||||
Sys_Printf( "Failed to set SIGFPE handler: %s\n", strerror( errno ) );
|
|
||||||
}
|
|
||||||
action.sa_sigaction = sig_handler;
|
|
||||||
} else if ( sigaction( siglist[ i ], &action, NULL ) != 0 ) {
|
|
||||||
Sys_Printf( "Failed to set %s handler: %s\n", signames[ i ], strerror( errno ) );
|
Sys_Printf( "Failed to set %s handler: %s\n", signames[ i ], strerror( errno ) );
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in a new issue