diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2011-03-01 10:21:31 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2011-03-01 10:21:31 -0500 |
| commit | fdd3983719f9d762111d56072b27ff48074d4d1f (patch) | |
| tree | b5a7cc0bd455474bea9a3eb5c1ef26ca76d48551 | |
| parent | 302f80cbd7449b0a4240e4372252da68051b03a2 (diff) | |
kernelshark: Have ^C on the command line kill the app
The python plugin overrides the default kill of SIGINT. Have kernelshark
add its own handler to kill it as well.
TODO: Perhaps have a pop up to ask for sure?
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | kernel-shark.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel-shark.c b/kernel-shark.c index b25325c..a0994d6 100644 --- a/kernel-shark.c +++ b/kernel-shark.c | |||
| @@ -1745,6 +1745,12 @@ button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data) | |||
| 1745 | return FALSE; | 1745 | return FALSE; |
| 1746 | } | 1746 | } |
| 1747 | 1747 | ||
| 1748 | static void sig_end(int sig) | ||
| 1749 | { | ||
| 1750 | fprintf(stderr, "kernelshark: Received SIGINT\n"); | ||
| 1751 | exit(0); | ||
| 1752 | } | ||
| 1753 | |||
| 1748 | void kernel_shark(int argc, char **argv) | 1754 | void kernel_shark(int argc, char **argv) |
| 1749 | { | 1755 | { |
| 1750 | struct tracecmd_input *handle; | 1756 | struct tracecmd_input *handle; |
| @@ -1798,6 +1804,9 @@ void kernel_shark(int argc, char **argv) | |||
| 1798 | input_file = argv[optind]; | 1804 | input_file = argv[optind]; |
| 1799 | } | 1805 | } |
| 1800 | 1806 | ||
| 1807 | /* The python plugin overrides ^C */ | ||
| 1808 | signal(SIGINT, sig_end); | ||
| 1809 | |||
| 1801 | info = g_new0(typeof(*info), 1); | 1810 | info = g_new0(typeof(*info), 1); |
| 1802 | if (!info) | 1811 | if (!info) |
| 1803 | die("Unable to allocate info"); | 1812 | die("Unable to allocate info"); |
