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

2012-05-16  Tobias Burnus  <burnus@net-b.de>

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

From-SVN: r187604
This commit is contained in:
Tobias Burnus 2012-05-16 20:39:34 +02:00 committed by Tobias Burnus
parent 4677d2eb61
commit e10f759e19
2 changed files with 6 additions and 2 deletions

View 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

View 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);