diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-07-17 14:54:30 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-07-17 14:54:30 -0400 |
commit | 82737beff97256e26a40cd9cee9c1d3f3e5ac4fa (patch) | |
tree | 4b9cc5fd6f8ec9970f66ddf8fd427dd33d776ca4 /main.cxx | |
parent | 8a3fc6c9f5336d2a4c8b776799e4ed4fabc5be35 (diff) | |
download | systemtap-steved-82737beff97256e26a40cd9cee9c1d3f3e5ac4fa.tar.gz systemtap-steved-82737beff97256e26a40cd9cee9c1d3f3e5ac4fa.tar.xz systemtap-steved-82737beff97256e26a40cd9cee9c1d3f3e5ac4fa.zip |
PR6030: control signal relay and accept deferred re-reception
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -260,11 +260,16 @@ printscript(systemtap_session& s, ostream& o) int pending_interrupts; extern "C" -void handle_interrupt (int sig) +void handle_interrupt (int sig) { + if (pending_interrupts == 0) + kill (0, sig); // Forward signals to child processes if any. + pending_interrupts ++; - kill (0, sig); // forward signals to child processes if any - if (pending_interrupts > 1) // XXX: should be configurable? time-based? + // NB: the "2" below is intended to skip the effect of the self-induced + // deferred signal coming from the kill() above. + + if (pending_interrupts > 2) // XXX: should be configurable? time-based? { char msg[] = "Too many interrupts received, exiting.\n"; int rc = write (2, msg, sizeof(msg)-1); |