diff --git a/[refs] b/[refs] index 21807153f4a5..08a2660b713a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7eac7e9e726c1b136bd7e0ad6671ce315f48bb18 +refs/heads/master: 266e0e219888420a1a7cafc82e82891cf7b5a979 diff --git a/trunk/tools/perf/builtin-record.c b/trunk/tools/perf/builtin-record.c index 90c98082af10..0345aad8eba5 100644 --- a/trunk/tools/perf/builtin-record.c +++ b/trunk/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;