From fdf96aa323491a7a07898aa9dc7888c8ed27ca26 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Sat, 30 Aug 2014 00:17:34 +0300 Subject: [PATCH] Use ISO C remove() instead of POSIX unlink() 2014-08-30 Janne Blomqvist * module.c (gfc_dump_module): Use ISO C remove() instead of POSIX unlink(). From-SVN: r214744 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/module.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 003e383afad..7c4a2c4a0ae 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2014-08-30 Janne Blomqvist + + * module.c (gfc_dump_module): Use ISO C remove() instead of POSIX + unlink(). + 2014-08-29 Jeffrey Armstrong PR fortran/62215 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index e8e8c98cb31..48ad9e857ad 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -6000,7 +6000,7 @@ gfc_dump_module (const char *name, int dump_flag) module file, even if it was already there. */ if (!dump_flag) { - unlink (filename); + remove (filename); return; } @@ -6040,7 +6040,7 @@ 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) + if (remove (filename) && errno != ENOENT) gfc_fatal_error ("Can't delete module file '%s': %s", filename, xstrerror (errno)); if (rename (filename_tmp, filename)) @@ -6049,7 +6049,7 @@ gfc_dump_module (const char *name, int dump_flag) } else { - if (unlink (filename_tmp)) + if (remove (filename_tmp)) gfc_fatal_error ("Can't delete temporary module file '%s': %s", filename_tmp, xstrerror (errno)); } -- 2.30.2