re PR libfortran/89020 (close(status='DELETE') does not remove file)

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.

From-SVN: r268301
This commit is contained in:
Jerry DeLisle 2019-01-26 20:27:16 +00:00
parent b4f964c8ed
commit 0e34715e97
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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>

View File

@ -99,7 +99,11 @@ st_close (st_parameter_close *clp)
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
@ -112,7 +116,10 @@ st_close (st_parameter_close *clp)
#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