#ifdef __linux__ for the crash handler. it compiles on other platforms,
but the functionality is bound to linux' /proc structure.
This commit is contained in:
parent
625f592fb7
commit
42ca262e39
|
@ -83,6 +83,7 @@ PACKAGE " " VERSION " - mailbox synchronizer\n"
|
||||||
exit( code );
|
exit( code );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
static void
|
static void
|
||||||
crashHandler( int n )
|
crashHandler( int n )
|
||||||
{
|
{
|
||||||
|
@ -94,7 +95,7 @@ crashHandler( int n )
|
||||||
dup2( 0, 1 );
|
dup2( 0, 1 );
|
||||||
dup2( 0, 2 );
|
dup2( 0, 2 );
|
||||||
error( "*** " EXE " caught signal %d. Starting debugger ...\n", n );
|
error( "*** " EXE " caught signal %d. Starting debugger ...\n", n );
|
||||||
switch ((dpid = fork ())) {
|
switch ((dpid = fork())) {
|
||||||
case -1:
|
case -1:
|
||||||
perror( "fork()" );
|
perror( "fork()" );
|
||||||
break;
|
break;
|
||||||
|
@ -110,6 +111,7 @@ crashHandler( int n )
|
||||||
}
|
}
|
||||||
exit( 3 );
|
exit( 3 );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
matches( const char *t, const char *p )
|
matches( const char *t, const char *p )
|
||||||
|
@ -438,11 +440,13 @@ main( int argc, char **argv )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
if (DFlags & DEBUG) {
|
if (DFlags & DEBUG) {
|
||||||
signal( SIGSEGV, crashHandler );
|
signal( SIGSEGV, crashHandler );
|
||||||
signal( SIGBUS, crashHandler );
|
signal( SIGBUS, crashHandler );
|
||||||
signal( SIGILL, crashHandler );
|
signal( SIGILL, crashHandler );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (merge_ops( cops, mvars->ops ))
|
if (merge_ops( cops, mvars->ops ))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user