提交 229c4eed 编写于 作者: M Mike Galbraith 提交者: Ingo Molnar

perf_counter tools: Guard against record damaging existing files

Signed-off-by: NMike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 22a4f650
......@@ -340,7 +340,7 @@ static int __cmd_record(int argc, const char **argv)
assert(nr_cpus <= MAX_NR_CPUS);
assert(nr_cpus >= 0);
output = open(output_name, O_CREAT|O_RDWR, S_IRWXU);
output = open(output_name, O_CREAT|O_EXCL|O_RDWR, S_IRWXU);
if (output < 0) {
perror("failed to create output file");
exit(-1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册