llvm.org GIT mirror llvm / e00c8fd
Open in read/write mode, creating the file if it doesn't exist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157501 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
109109 char *filename;
110110 filename = mangle_filename(orig_filename);
111111 recursive_mkdir(filename);
112 output_file = fopen(filename, "wb");
112 output_file = fopen(filename, "w+b");
113113
114114 if (!output_file) {
115115 const char *cptr = strrchr(orig_filename, '/');
116 output_file = fopen(cptr ? cptr + 1 : orig_filename, "wb");
116 output_file = fopen(cptr ? cptr + 1 : orig_filename, "w+b");
117117
118118 if (!output_file) {
119 fprintf(stderr, "LLVM profiling runtime: while opening '%s': ",
119 fprintf(stderr, "LLVM profiling runtime: cannot open '%s': ",
120120 cptr ? cptr + 1 : orig_filename);
121121 perror("");
122122 return;