Skip to content

Commit

Permalink
perf_counter tools: Guard against record damaging existing files
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Jun 1, 2009
1 parent 22a4f65 commit 229c4ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/perf_counter/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 229c4ee

Please sign in to comment.