diff options
author | Mike Galbraith <efault@gmx.de> | 2009-05-28 10:28:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-01 14:10:24 -0400 |
commit | 229c4eedcedcdadf70411120ba34bc37554a74bd (patch) | |
tree | 6979cf7cf44977c95fd8a41a2ac265e7c52d5559 /Documentation/perf_counter/builtin-record.c | |
parent | 22a4f650d686eeaac3629dae1c4294381485efdf (diff) |
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/perf_counter/builtin-record.c')
-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) | |||
340 | assert(nr_cpus <= MAX_NR_CPUS); | 340 | assert(nr_cpus <= MAX_NR_CPUS); |
341 | assert(nr_cpus >= 0); | 341 | assert(nr_cpus >= 0); |
342 | 342 | ||
343 | output = open(output_name, O_CREAT|O_RDWR, S_IRWXU); | 343 | output = open(output_name, O_CREAT|O_EXCL|O_RDWR, S_IRWXU); |
344 | if (output < 0) { | 344 | if (output < 0) { |
345 | perror("failed to create output file"); | 345 | perror("failed to create output file"); |
346 | exit(-1); | 346 | exit(-1); |