diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2015-09-04 00:18:56 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2015-09-04 00:18:56 +0300 |
commit | 43ff5c7a2dd5912a3bf90bd0f9cc599ac3a3acce (patch) | |
tree | 593d7f86e1d9512136f291a704411e7af2722593 /gcc | |
parent | c8c030589bd61290418753e766f26d8f99e8b074 (diff) | |
download | gcc-43ff5c7a2dd5912a3bf90bd0f9cc599ac3a3acce.zip gcc-43ff5c7a2dd5912a3bf90bd0f9cc599ac3a3acce.tar.gz gcc-43ff5c7a2dd5912a3bf90bd0f9cc599ac3a3acce.tar.bz2 |
libgfortran: Use remove(3) instead of unlink(2) when deleting files.
testsuite:
2015-09-04 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.dg/read_dir.f90: Delete empty directory when closing
rather than calling rmdir, cleanup if open fails.
libgfortran:
2015-09-04 Janne Blomqvist <jb@gcc.gnu.org>
* io/unix.h (delete_file): Remove prototype.
* io/unix.c (delete_file): Remove function.
* io/close.c (st_close): Replace delete_file and unlink with
remove.
* io/open.c (already_open): Replace unlink with remove.
From-SVN: r227472
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/read_dir.f90 | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13f5d7e..e2c55ba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-09-04 Janne Blomqvist <jb@gcc.gnu.org> + + * gfortran.dg/read_dir.f90: Delete empty directory when closing + rather than calling rmdir, cleanup if open fails. + 2015-09-03 Bill Schmidt <wschmidt@vnet.linux.ibm.com> * gcc.target/powerpc/vec-mult-char-1.c: New test. diff --git a/gcc/testsuite/gfortran.dg/read_dir.f90 b/gcc/testsuite/gfortran.dg/read_dir.f90 index 0e28f9f..4009ed6 100644 --- a/gcc/testsuite/gfortran.dg/read_dir.f90 +++ b/gcc/testsuite/gfortran.dg/read_dir.f90 @@ -7,13 +7,14 @@ program bug integer ios call system('[ -d junko.dir ] || mkdir junko.dir') open(unit=10, file='junko.dir',iostat=ios,action='read',access='stream') - if (ios.ne.0) call abort + if (ios.ne.0) then + call system('rmdir junko.dir') + call abort + end if read(10, iostat=ios) c if (ios.ne.21) then - close(10) - call system('rmdir junko.dir') + close(10, status='delete') call abort end if - close(10) - call system('rmdir junko.dir') + close(10, status='delete') end program bug |