Changeset 1f68d5d
- Timestamp:
- Jun 1, 2021, 2:22:37 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- bc179fd3
- Parents:
- 68ff3de
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r68ff3de r1f68d5d 160 160 #define SIGPARMS int sig __attribute__(( unused )), siginfo_t * sfp __attribute__(( unused )), ucontext_t * cxt __attribute__(( unused )) 161 161 162 static void Signal( int sig, void (* handler)(SIGPARMS), int flags ) { 163 struct sigaction act; 164 165 act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; 162 static void _Signal(struct sigaction & act, int sig, int flags ) { 166 163 act.sa_flags = flags; 167 164 … … 170 167 _exit( EXIT_FAILURE ); 171 168 } // if 169 } 170 171 static void Signal( int sig, void (* handler)(SIGPARMS), int flags ) { 172 struct sigaction act; 173 act.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; 174 _Signal(act, sig, flags); 175 } // Signal 176 177 static void Signal( int sig, void (* handler)(int), int flags ) { 178 struct sigaction act; 179 act.sa_handler = handler; 180 _Signal(act, sig, flags); 172 181 } // Signal 173 182 … … 202 211 static void sigAbortHandler( SIGPARMS ) { 203 212 backtrace( 6 ); // skip first 6 stack frames 204 Signal( SIGABRT, (void (*)(SIGPARMS))SIG_DFL, SA_SIGINFO ); // reset default signal handler213 Signal( SIGABRT, SIG_DFL, SA_SIGINFO ); // reset default signal handler 205 214 raise( SIGABRT ); // reraise SIGABRT 206 215 } // sigAbortHandler
Note: See TracChangeset
for help on using the changeset viewer.