diff options
Diffstat (limited to 'gcc-4.9/gcc/fortran/module.c')
-rw-r--r-- | gcc-4.9/gcc/fortran/module.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc-4.9/gcc/fortran/module.c b/gcc-4.9/gcc/fortran/module.c index 2bfe177..f50c5b7 100644 --- a/gcc-4.9/gcc/fortran/module.c +++ b/gcc-4.9/gcc/fortran/module.c @@ -6072,7 +6072,10 @@ gfc_dump_module (const char *name, int dump_flag) || crc_old != crc) { /* Module file have changed, replace the old one. */ - if (rename (filename_tmp, filename)) + 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)); } |