diff options
author | Mike Galbraith <efault@gmx.de> | 2009-05-28 18:28:53 +0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-01 22:10:24 +0400 |
commit | 229c4eedcedcdadf70411120ba34bc37554a74bd (patch) | |
tree | 6979cf7cf44977c95fd8a41a2ac265e7c52d5559 /Documentation | |
parent | 22a4f650d686eeaac3629dae1c4294381485efdf (diff) | |
download | linux-229c4eedcedcdadf70411120ba34bc37554a74bd.tar.xz |
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>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/perf_counter/builtin-record.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c index 23d1224ce98c..96bfb7c5f1e4 100644 --- a/Documentation/perf_counter/builtin-record.c +++ b/Documentation/perf_counter/builtin-record.c @@ -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); |