diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-05-23 18:08:22 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-05-23 18:08:22 +0000 |
commit | a600457cde675bcb49fd31d0ccc98495b4bdb4d8 (patch) | |
tree | 1e7e1f4457709247da00c9f0767d00fffa67f566 /compiler-rt/lib/profile/GCDAProfiling.c | |
parent | 5bd0b9e53bcf55fb750d179278cacc1502ad82e8 (diff) | |
download | bcm5719-llvm-a600457cde675bcb49fd31d0ccc98495b4bdb4d8.tar.gz bcm5719-llvm-a600457cde675bcb49fd31d0ccc98495b4bdb4d8.zip |
Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing this out.
llvm-svn: 182598
Diffstat (limited to 'compiler-rt/lib/profile/GCDAProfiling.c')
-rw-r--r-- | compiler-rt/lib/profile/GCDAProfiling.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c index 71dd9bd67aa..e58cceabfcc 100644 --- a/compiler-rt/lib/profile/GCDAProfiling.c +++ b/compiler-rt/lib/profile/GCDAProfiling.c @@ -229,13 +229,14 @@ void llvm_gcda_start_file(const char *orig_filename, const char version[4]) { 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); |