PR 62215 Reinstate unlinking old module file before renaming.

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.

From-SVN: r214742
This commit is contained in:
Jeffrey Armstrong 2014-08-29 20:46:15 +00:00 committed by Janne Blomqvist
parent 08216dfb85
commit 70103202db
2 changed files with 9 additions and 0 deletions

View File

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

View File

@ -6040,6 +6040,9 @@ gfc_dump_module (const char *name, int dump_flag)
|| 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));