+2019-01-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/88020
+ * io/close.c (st_close): Generate error if calls to 'remove' return
+ an error.
+
2019-01-17 Andrew Stubbs <ams@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
Julian Brown <julian@codesourcery.com>
else
{
#if HAVE_UNLINK_OPEN_FILE
- remove (u->filename);
+
+ if (remove (u->filename))
+ generate_error (&clp->common, LIBERROR_OS,
+ "File cannot be deleted, possibly in use by"
+ " another process");
#else
path = strdup (u->filename);
#endif
#if !HAVE_UNLINK_OPEN_FILE
if (path != NULL)
{
- remove (path);
+ if (remove (u->filename))
+ generate_error (&clp->common, LIBERROR_OS,
+ "File cannot be deleted, possibly in use by"
+ " another process");
free (path);
}
#endif