diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c index 0ec2b2d1..a36d72e4 100644 --- a/tracecmd/trace-read.c +++ b/tracecmd/trace-read.c @@ -1365,7 +1365,14 @@ struct tracecmd_input *read_trace_header(const char *file, int flags) static void sig_end(int sig) { + struct handle_list *handles; + fprintf(stderr, "trace-cmd: Received SIGINT\n"); + + list_for_each_entry(handles, &handle_list, list) { + tracecmd_close(handles->handle); + } + exit(0); }
When "trace-cmd report" is interrupted with "ctrl-c", close the input hanlders to opened trace files, to delete any temporary files used when reading the trace data. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- tracecmd/trace-read.c | 7 +++++++ 1 file changed, 7 insertions(+)