As Robert Mason pointed out, the POSIX open call already contains the
mode ("S_IRUSR | S_IWUSR" is the same as 0600).
I somehow must have missed the "," and read it as "|". The extra
argument does not harm as open is variadic; nonetheless, it makes sense
to remove the extra argument.
Committed as Rev. 188048.
Tobias
Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog (Revision 188023)
+++ libgfortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,10 @@
+2012-05-31 Tobias Burnus <bur...@net-b.de>
+
+ Revert:
+ 2012-05-16 Tobias Burnus <bur...@net-b.de>
+
+ * io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT.
+
2012-05-30 Tobias Burnus <bur...@net-b.de>
* io/io.h: Fix comment typos.
Index: libgfortran/io/unix.c
===================================================================
--- libgfortran/io/unix.c (Revision 188023)
+++ libgfortran/io/unix.c (Arbeitskopie)
@@ -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, 0600);
+ S_IRUSR | S_IWUSR);
#else
- fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR, 0600);
+ fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
#endif
}
while (fd == -1 && errno == EEXIST);