diff options
author | John Kacur <jkacur@redhat.com> | 2017-03-21 17:11:53 +0100 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-04-26 10:49:42 -0400 |
commit | 83c1851afdd413e7e81b93333992f1127a558ffc (patch) | |
tree | 6ca03b2e48302cd386250f361655fcf15e5c7f3f | |
parent | 81921e3408367cbe56d5a5596fe956897643987c (diff) | |
download | trace-cmd-83c1851afdd413e7e81b93333992f1127a558ffc.tar.gz |
trace-cmd: Fix segmentation fault in trace-snapshot
To reproduce the problem:
plugin 'wakeup'
trace-cmd: Device or resource busy
Segmentation fault (core dumped)
When the user triggers a condition such as EBUSY the program should die
gracefully. The problem here is simply caused by an extra conversion
specifier in "die" in the write_file function
Link: http://lkml.kernel.org/r/1490112713-9456-1-git-send-email-jkacur@redhat.com
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | trace-snapshot.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/trace-snapshot.c b/trace-snapshot.c index 9d3608c4..771b065c 100644 --- a/trace-snapshot.c +++ b/trace-snapshot.c @@ -42,7 +42,8 @@ static void write_file(const char *name, char *val) n = write(fd, val, strlen(val)); if (n < 0) - die("failed to write '%d' to %s\n", path); + die("failed to write to %s\n", path); + tracecmd_put_tracing_file(path); close(fd); } |