[llvm] r186414 - Create files with mode 666. This matches the behavior of other unix tools.

Rafael Espindola rafael.espindola at gmail.com
Tue Jul 16 07:10:07 PDT 2013


Author: rafael
Date: Tue Jul 16 09:10:07 2013
New Revision: 186414

URL: http://llvm.org/viewvc/llvm-project?rev=186414&view=rev
Log:
Create files with mode 666. This matches the behavior of other unix tools.

Added:
    llvm/trunk/test/Other/umask.ll
Modified:
    llvm/trunk/lib/Support/raw_ostream.cpp

Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=186414&r1=186413&r2=186414&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Jul 16 09:10:07 2013
@@ -461,7 +461,7 @@ raw_fd_ostream::raw_fd_ostream(const cha
   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;

Added: llvm/trunk/test/Other/umask.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/umask.ll?rev=186414&view=auto
==============================================================================
--- llvm/trunk/test/Other/umask.ll (added)
+++ llvm/trunk/test/Other/umask.ll Tue Jul 16 09:10:07 2013
@@ -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-





More information about the llvm-commits mailing list