summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp2
-rw-r--r--llvm/test/Other/umask.ll13
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 92629453583..7609b916fba 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -461,7 +461,7 @@ raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
if (Flags & F_Excl)
OpenFlags |= O_EXCL;
- while ((FD = open(Filename, OpenFlags, 0664)) < 0) {
+ while ((FD = open(Filename, OpenFlags, 0666)) < 0) {
if (errno != EINTR) {
ErrorInfo = "Error opening output file '" + std::string(Filename) + "'";
ShouldClose = false;
diff --git a/llvm/test/Other/umask.ll b/llvm/test/Other/umask.ll
new file mode 100644
index 00000000000..37f379dcb30
--- /dev/null
+++ b/llvm/test/Other/umask.ll
@@ -0,0 +1,13 @@
+; REQUIRES: shell
+
+; RUN: umask 000
+; RUN: rm -f %t.000
+; RUN: llvm-as %s -o %t.000
+; RUN: ls -l %t.000 | FileCheck --check-prefix=CHECK000 %s
+; CHECK000: rw-rw-rw
+
+; RUN: umask 002
+; RUN: rm -f %t.002
+; RUN: llvm-as %s -o %t.002
+; RUN: ls -l %t.002 | FileCheck --check-prefix=CHECK002 %s
+; CHECK002: rw-rw-r-
OpenPOWER on IntegriCloud