diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-08-15 12:43:13 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-08-15 12:43:13 +0100 |
commit | 824df399a31fe92d88eb8caf86768cc8c7c72a06 (patch) | |
tree | f966f72be04d1eb53e17b7866c6f49bf2b7d3b93 /tools/perf/builtin-record.c | |
parent | 8b6120789598d55f6aa2b4e9ac7e70a205d857da (diff) | |
parent | 48ec45e725aa385d72bced73b267dfaf13351876 (diff) |
Merge branch 's3c-fixes' of git://aeryn.fluff.org.uk/bjdooks/linux
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 90c98082af10..0345aad8eba5 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -525,10 +525,14 @@ static int __cmd_record(int argc, const char **argv) signal(SIGCHLD, sig_handler); signal(SIGINT, sig_handler); - if (!stat(output_name, &st) && !force && !append_file) { - fprintf(stderr, "Error, output file %s exists, use -A to append or -f to overwrite.\n", - output_name); - exit(-1); + if (!stat(output_name, &st) && st.st_size) { + if (!force && !append_file) { + fprintf(stderr, "Error, output file %s exists, use -A to append or -f to overwrite.\n", + output_name); + exit(-1); + } + } else { + append_file = 0; } flags = O_CREAT|O_RDWR; |