Skip to content

Commit e08b59f

Browse files
committed
Create files with mode 666. This matches the behavior of other unix tools.
llvm-svn: 186414
1 parent 5f4535b commit e08b59f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

llvm/lib/Support/raw_ostream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
461461
if (Flags & F_Excl)
462462
OpenFlags |= O_EXCL;
463463

464-
while ((FD = open(Filename, OpenFlags, 0664)) < 0) {
464+
while ((FD = open(Filename, OpenFlags, 0666)) < 0) {
465465
if (errno != EINTR) {
466466
ErrorInfo = "Error opening output file '" + std::string(Filename) + "'";
467467
ShouldClose = false;

llvm/test/Other/umask.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; REQUIRES: shell
2+
3+
; RUN: umask 000
4+
; RUN: rm -f %t.000
5+
; RUN: llvm-as %s -o %t.000
6+
; RUN: ls -l %t.000 | FileCheck --check-prefix=CHECK000 %s
7+
; CHECK000: rw-rw-rw
8+
9+
; RUN: umask 002
10+
; RUN: rm -f %t.002
11+
; RUN: llvm-as %s -o %t.002
12+
; RUN: ls -l %t.002 | FileCheck --check-prefix=CHECK002 %s
13+
; CHECK002: rw-rw-r-

0 commit comments

Comments
 (0)