public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, libgfortran, committed] Remove send "mode" argument to POSIX "open"
@ 2012-05-31  6:11 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2012-05-31  6:11 UTC (permalink / raw)
  To: gcc patches, gfortran

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

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

[-- Attachment #2: commit.log --]
[-- Type: text/x-log, Size: 1091 bytes --]

Index: libgfortran/ChangeLog
===================================================================
--- libgfortran/ChangeLog	(Revision 188023)
+++ libgfortran/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,10 @@
+2012-05-31  Tobias Burnus  <burnus@net-b.de>
+
+	Revert:
+	2012-05-16  Tobias Burnus  <burnus@net-b.de>
+
+	* io/unix.c (tempfile_open): Pass mode to "open" for O_CREAT.
+
 2012-05-30  Tobias Burnus  <burnus@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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-31  6:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31  6:11 [Patch, libgfortran, committed] Remove send "mode" argument to POSIX "open" Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).