diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-03-29 12:17:38 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-03-29 12:17:38 -0400 |
commit | d6f2926f12dcfe5f880a490e368800cd5fcfa03e (patch) | |
tree | 2bdee8b19c42db17bd41f2ce2294ed4df25764ce | |
parent | aa77b2d95d404e9e0e1e9687f69a5fd70db6bc11 (diff) |
trace-cmd: Move to output dir specified by -d in listen command
If -d is specified on the command line for 'trace-cmd listen' then
change to that directory to write the data files to.
Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-listen.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/trace-listen.c b/trace-listen.c index 9a1981b..419cbd1 100644 --- a/trace-listen.c +++ b/trace-listen.c | |||
@@ -507,6 +507,9 @@ void trace_listen(int argc, char **argv) | |||
507 | if (!output_dir) | 507 | if (!output_dir) |
508 | output_dir = default_output_dir; | 508 | output_dir = default_output_dir; |
509 | 509 | ||
510 | if (chdir(output_dir) < 0) | ||
511 | die("Can't access directory %s", output_dir); | ||
512 | |||
510 | if (daemon) | 513 | if (daemon) |
511 | start_daemon(); | 514 | start_daemon(); |
512 | 515 | ||