[compiler-rt] r182598 - Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing this out.
Bill Wendling
isanbard at gmail.com
Thu May 23 11:08:23 PDT 2013
Author: void
Date: Thu May 23 13:08:22 2013
New Revision: 182598
URL: http://llvm.org/viewvc/llvm-project?rev=182598&view=rev
Log:
Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing this out.
Modified:
compiler-rt/trunk/lib/profile/GCDAProfiling.c
Modified: compiler-rt/trunk/lib/profile/GCDAProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/GCDAProfiling.c?rev=182598&r1=182597&r2=182598&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/GCDAProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/GCDAProfiling.c Thu May 23 13:08:22 2013
@@ -229,13 +229,14 @@ void llvm_gcda_start_file(const char *or
if (fd == -1) {
/* Try opening the file, creating it if necessary. */
+ int mode = 0644;
new_file = 1;
mode = "w+b";
- fd = open(filename, O_RDWR | O_CREAT);
+ fd = open(filename, O_RDWR | O_CREAT, mode);
if (fd == -1) {
/* Try creating the directories first then opening the file. */
recursive_mkdir(filename);
- fd = open(filename, O_RDWR | O_CREAT);
+ fd = open(filename, O_RDWR | O_CREAT, mode);
if (!output_file) {
/* Bah! It's hopeless. */
fprintf(stderr, "profiling:%s: cannot open\n", filename);
More information about the llvm-commits
mailing list