aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-11-25 12:51:44 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2008-11-25 13:51:44 +0100
commit056c165212dafd1e959042bfac11509eb0e187d7 (patch)
treedaaa9930efdae177106c0eb0462445b1631612f9 /gcc
parentb0ff8d7af505e40e4bbb82f31604b99b59f67231 (diff)
downloadgcc-056c165212dafd1e959042bfac11509eb0e187d7.zip
gcc-056c165212dafd1e959042bfac11509eb0e187d7.tar.gz
gcc-056c165212dafd1e959042bfac11509eb0e187d7.tar.bz2
re PR fortran/38248 (Ignored temporary module files manipulation errors)
2008-11-25 Jan Kratochvil <jan.kratochvil@redhat.com> PR fortran/38248 * module.c (gfc_dump_module): Check rename/unlink syscalls errors. From-SVN: r142190
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/module.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 22f2817..a75f983 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-25 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR fortran/38248
+ * module.c (gfc_dump_module): Check rename/unlink syscalls errors.
+
2008-11-25 Eric Botcazou <ebotcazou@adacore.com>
PR fortran/37319
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 35f5ce5..a49745a 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -4850,11 +4850,19 @@ gfc_dump_module (const char *name, int dump_flag)
|| memcmp (md5_old, md5_new, sizeof (md5_old)) != 0)
{
/* Module file have changed, replace the old one. */
- unlink (filename);
- rename (filename_tmp, filename);
+ if (unlink (filename))
+ gfc_fatal_error ("Can't delete module file '%s': %s", filename,
+ strerror (errno));
+ if (rename (filename_tmp, filename))
+ gfc_fatal_error ("Can't rename module file '%s' to '%s': %s",
+ filename_tmp, filename, strerror (errno));
}
else
- unlink (filename_tmp);
+ {
+ if (unlink (filename_tmp))
+ gfc_fatal_error ("Can't delete temporary module file '%s': %s",
+ filename_tmp, strerror (errno));
+ }
}