forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trace2: intercept all common signals
We already use trace2 to find out about unexpected pipe breakages, which is nice for detecting bugs or system problems, by adding a handler for SIGPIPE which simply writes a trace2 line. However, there are a handful of other common signals which we might want to snoop on: - SIGINT, SIGTERM, or SIGQUIT, when a user manually cancels a command in frustration or mistake (via Ctrl-C, Ctrl-D, or `kill`) - SIGHUP, when the network closes unexpectedly (indicating there may be a problem to solve) There are lots more signals which we might find useful later, but at least let's teach trace2 to report these egregious ones. Conveniently, they're also already covered by the `_common` variants in sigchain.[ch]. Sigchain itself is already tested via helper/test-sigchain.c, and trace2 is tested in a number of places - let's also add tests demonstrating that sigchain + trace2 works correctly. Signed-off-by: Emily Shaffer <nasamuffin@google.com>
- Loading branch information
1 parent
0f3415f
commit f4e6077
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters