[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-229c4eedcedcdadf70411120ba34bc37554a74bd@git.kernel.org>
Date: Mon, 1 Jun 2009 18:42:32 GMT
From: tip-bot for Mike Galbraith <efault@....de>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, efault@....de, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:perfcounters/core] perf_counter tools: Guard against record damaging existing files
Commit-ID: 229c4eedcedcdadf70411120ba34bc37554a74bd
Gitweb: http://git.kernel.org/tip/229c4eedcedcdadf70411120ba34bc37554a74bd
Author: Mike Galbraith <efault@....de>
AuthorDate: Thu, 28 May 2009 16:28:53 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Mon, 1 Jun 2009 20:10:24 +0200
perf_counter tools: Guard against record damaging existing files
Signed-off-by: Mike Galbraith <efault@....de>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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 23d1224..96bfb7c 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists