Changeset 94dea96


Ignore:
Timestamp:
May 1, 2018, 4:09:15 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
5da5a96
Parents:
4c80a75
Message:

add run-time signal-handlers for SIGTERM and SIGINT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/interpose.c

    r4c80a75 r94dea96  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  8 16:18:09 2018
    13 // Update Count     : 75
     12// Last Modified On : Tue May  1 15:05:35 2018
     13// Update Count     : 83
    1414//
    1515
     
    9595void sigHandler_fpe  ( __CFA_SIGPARMS__ );
    9696void sigHandler_abort( __CFA_SIGPARMS__ );
     97void sigHandler_term ( __CFA_SIGPARMS__ );
    9798
    9899struct {
     
    114115                __cfaabi_sigaction( SIGFPE , sigHandler_fpe  , SA_SIGINFO ); // Failure handler
    115116                __cfaabi_sigaction( SIGABRT, sigHandler_abort, SA_SIGINFO ); // Failure handler
     117                __cfaabi_sigaction( SIGTERM, sigHandler_term , SA_SIGINFO ); // Failure handler
     118                __cfaabi_sigaction( SIGINT , sigHandler_term , SA_SIGINFO ); // Failure handler
    116119        }
    117120}
     
    268271}
    269272
     273void sigHandler_term( __CFA_SIGPARMS__ ) {
     274        abort( "Application stopped by %s signal.", sig == SIGINT ? "an interrupt (SIGINT)" : "a terminate (SIGTERM)" );
     275}
     276
    270277// Local Variables: //
    271278// mode: c //
Note: See TracChangeset for help on using the changeset viewer.