[Bug libfortran/66936] io/unix.c gratuitously uses S_IRWXG and S_IRWXO on the basis that umask() is available

fxcoudert at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 6 16:57:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-08-06
                 CC|                            |fxcoudert at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |fxcoudert at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #11 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
What I do not understand is how this didn't show up before now, since the
relevant libgfortran code was committed in 2012, and the mingw-w64 project has
been providing gfortran builds throughout this time.


Other than that, I would simply suggest we don't use umask() on mingw targets
(no need to make useless system calls):

Index: io/unix.c
===================================================================
--- io/unix.c   (revision 226632)
+++ io/unix.c   (working copy)
@@ -1083,6 +1083,14 @@ set_close_on_exec (int fd __attribute__ 
 }


+/* On mingw, we don't use umask in the function below, because it
+   doesn't support the user/group/other-based permissions.  */
+
+#ifdef __MINGW32__
+#undef HAVE_UMASK
+#endif
+
+
 /* Helper function for tempfile(). Tries to open a temporary file in
    the directory specified by tempdir. If successful, the file name is
    stored in fname and the descriptor returned. Returns -1 on


Can someone (Keith?) actually confirm that this restores the build on mingw32?
(It should, but double-checking never hurts.)



More information about the Gcc-bugs mailing list