Changeset 8a13c47 for libcfa/src/bits/signal.hfa
- Timestamp:
- Jan 30, 2020, 10:59:12 PM (3 years ago)
- Branches:
- ADT, arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6f302cd
- Parents:
- 052dfc3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/signal.hfa
r052dfc3 r8a13c47 40 40 sigaddset( &act.sa_mask, SIGALRM ); // disabled during signal handler 41 41 sigaddset( &act.sa_mask, SIGUSR1 ); 42 sigaddset( &act.sa_mask, SIGSEGV ); 43 sigaddset( &act.sa_mask, SIGBUS ); 44 sigaddset( &act.sa_mask, SIGILL ); 45 sigaddset( &act.sa_mask, SIGFPE ); 46 sigaddset( &act.sa_mask, SIGHUP ); // revert to default on second delivery 47 sigaddset( &act.sa_mask, SIGTERM ); 48 sigaddset( &act.sa_mask, SIGINT ); 42 49 act.sa_flags = flags; 43 50 44 if ( sigaction( sig, &act, NULL) == -1 ) {51 if ( sigaction( sig, &act, 0p ) == -1 ) { 45 52 __cfaabi_dbg_print_buffer_decl( 46 53 " __cfaabi_sigaction( sig:%d, handler:%p, flags:%d ), problem installing signal handler, error(%d) %s.\n", … … 48 55 ); 49 56 _exit( EXIT_FAILURE ); 50 } 57 } // if 51 58 } 52 53 // Sigaction wrapper : restore default handler54 static void __cfaabi_sigdefault( int sig ) {55 struct sigaction act;56 57 act.sa_handler = SIG_DFL;58 act.sa_flags = 0;59 sigemptyset( &act.sa_mask );60 61 if ( sigaction( sig, &act, NULL ) == -1 ) {62 __cfaabi_dbg_print_buffer_decl(63 " __cfaabi_sigdefault( sig:%d ), problem reseting signal handler, error(%d) %s.\n",64 sig, errno, strerror( errno )65 );66 _exit( EXIT_FAILURE );67 }68 }
Note: See TracChangeset
for help on using the changeset viewer.