summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/GCDAProfiling.c
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-05-23 18:08:22 +0000
committerBill Wendling <isanbard@gmail.com>2013-05-23 18:08:22 +0000
commita600457cde675bcb49fd31d0ccc98495b4bdb4d8 (patch)
tree1e7e1f4457709247da00c9f0767d00fffa67f566 /compiler-rt/lib/profile/GCDAProfiling.c
parent5bd0b9e53bcf55fb750d179278cacc1502ad82e8 (diff)
downloadbcm5719-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.c5
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);
OpenPOWER on IntegriCloud