From: Janne Blomqvist Date: Fri, 29 Aug 2014 21:17:34 +0000 (+0300) Subject: Use ISO C remove() instead of POSIX unlink() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdf96aa323491a7a07898aa9dc7888c8ed27ca26;p=gcc.git 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 --- 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)); }