mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-09 08:27:00 +08:00
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:
parent
b4f964c8ed
commit
0e34715e97
@ -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>
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user