From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49333 invoked by alias); 20 Jul 2015 15:26:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 46465 invoked by uid 48); 20 Jul 2015 15:26:37 -0000 From: "keith.marshall at mailinator dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/66936] io/unix.c gratuitously uses S_IRWXG and S_IRWXO on the basis that umask() is available Date: Mon, 20 Jul 2015 15:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: keith.marshall at mailinator dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01734.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936 --- Comment #10 from Keith Marshall --- (In reply to Andrew Pinski from comment #9) > Well it is a libgfortran bug yes. Which, being pedantic, makes it a GCC bug, because libgfortran is a component of GCC. > What we could do add to io/unix.c: > #if MINGW && !defined(S_IRWXG) > #define S_IRWXG 0 > #endif > #if MINGW && !defined(S_IRWXO) > #define S_IRWXO 0 > #endif > > And that will allow it to work correctly. Conceptually, yes; you'd actually need to test on __MINGW32__, or maybe even more generically on _WIN32, rather than on (nonexistent) MINGW. However, that seems every bit as much of a kludge as my own work-around. Realistically, calling umask() in this context on native windows would seem to be completely redundant anyway; I can't see how it will actually achieve anything, since all it will do will be to reproduce the already existing state, at the time of the call.