mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-08 13:26:19 +00:00
Open in read/write mode, creating the file if it doesn't exist.
llvm-svn: 157501
This commit is contained in:
parent
eadb471c54
commit
3651e385d6
@ -110,14 +110,14 @@ void llvm_gcda_start_file(const char *orig_filename) {
|
||||
char *filename;
|
||||
filename = mangle_filename(orig_filename);
|
||||
recursive_mkdir(filename);
|
||||
output_file = fopen(filename, "wb");
|
||||
output_file = fopen(filename, "w+b");
|
||||
|
||||
if (!output_file) {
|
||||
const char *cptr = strrchr(orig_filename, '/');
|
||||
output_file = fopen(cptr ? cptr + 1 : orig_filename, "wb");
|
||||
output_file = fopen(cptr ? cptr + 1 : orig_filename, "w+b");
|
||||
|
||||
if (!output_file) {
|
||||
fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",
|
||||
fprintf(stderr, "LLVM profiling runtime: cannot open '%s': ",
|
||||
cptr ? cptr + 1 : orig_filename);
|
||||
perror("");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user