OSDN Git Service

2012-05-16 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 May 2012 18:39:34 +0000 (18:39 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 May 2012 18:39:34 +0000 (18:39 +0000)
        * io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187604 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/unix.c

index 088d517..cac6a62 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-16  Tobias Burnus  <burnus@net-b.de>
+
+       * io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT.
+
 2012-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR fortran/52428
index c81163f..2e59efd 100644 (file)
@@ -1099,9 +1099,9 @@ tempfile_open (const char *tempdir, char **fname)
 
 #if defined(HAVE_CRLF) && defined(O_BINARY)
       fd = open (template, O_RDWR | O_CREAT | O_EXCL | O_BINARY,
-                S_IRUSR | S_IWUSR);
+                S_IRUSR | S_IWUSR, 0600);
 #else
-      fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+      fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR, 0600);
 #endif
     }
   while (fd == -1 && errno == EEXIST);