public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, fortran, committed] PR 62215 Unlink old module file before renaming
@ 2014-08-29 20:52 Janne Blomqvist
  0 siblings, 0 replies; only message in thread
From: Janne Blomqvist @ 2014-08-29 20:52 UTC (permalink / raw)
  To: Fortran List, GCC Patches

Hi,

per the discussion in the PR, committed the attached patch to trunk
and 4.9, which fixes a regression I introduced when implementing the
zlib compressed module files stuff:


Index: ChangeLog
===================================================================
--- ChangeLog   (revision 214738)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2014-08-29  Jeffrey Armstrong  <jeffrey.armstrong@approximatrix.com>
+
+       PR fortran/62215
+       * module.c (gfc_dump_module): Unlink old module file before
+       renaming new one.
+
 2014-08-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

        * frontend_passes (expr_array):  Replace by vec template.
Index: module.c
===================================================================
--- module.c    (revision 214738)
+++ module.c    (working copy)
@@ -6040,6 +6040,9 @@ gfc_dump_module (const char *name, int d
       || crc_old != crc)
     {
       /* Module file have changed, replace the old one.  */
+      if (unlink (filename) && errno != ENOENT)
+       gfc_fatal_error ("Can't delete module file '%s': %s", filename,
+                        xstrerror (errno));
       if (rename (filename_tmp, filename))
        gfc_fatal_error ("Can't rename module file '%s' to '%s': %s",
                         filename_tmp, filename, xstrerror (errno));

-- 
Janne Blomqvist

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

only message in thread, other threads:[~2014-08-29 20:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-29 20:52 [Patch, fortran, committed] PR 62215 Unlink old module file before renaming Janne Blomqvist

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).