]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
unix.c (tempfile_open): Pass mode to "open" for O_CREAT.
authorTobias Burnus <burnus@net-b.de>
Wed, 16 May 2012 18:39:34 +0000 (20:39 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 16 May 2012 18:39:34 +0000 (20:39 +0200)
2012-05-16  Tobias Burnus  <burnus@net-b.de>

        * io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT.

From-SVN: r187604

libgfortran/ChangeLog
libgfortran/io/unix.c

index 088d51786d727a13a2147526ec6cf764442afdcc..cac6a62d147adfd5ec848b1cf3c97d3ef9937579 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 c81163f25635145f3df3d3661fb716ecd94eb149..2e59efdba7382a40bb1b3d32aeb0c446b5f09a7f 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);