mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
perf_counter tools: Guard against record damaging existing files
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>
This commit is contained in:
parent
22a4f650d6
commit
229c4eedce
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue