diff options
author | Thomas Koenig <Thomas.Koenig@online.de> | 2005-01-22 19:49:18 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2005-01-22 19:49:18 +0000 |
commit | d02b2c6474afab3e4d5748eca254bcf9aa12fa18 (patch) | |
tree | fda79f894c069363a2ace1fa2cd36b81203001de /gcc | |
parent | d7c71ee3e6bd95291f0f33a7fdd7de00980ce3fd (diff) | |
download | gcc-d02b2c6474afab3e4d5748eca254bcf9aa12fa18.zip gcc-d02b2c6474afab3e4d5748eca254bcf9aa12fa18.tar.gz gcc-d02b2c6474afab3e4d5748eca254bcf9aa12fa18.tar.bz2 |
re PR libfortran/18982 (open(status="new") does not generate an error if the file exists)
2005-01-22 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/18982
* io/unix.c (regular_file): No need to change flags->action
if an error occurs. Document this.
No need to call stat() for STATUS_OLD, open() will
fail anyway.
For ACTION_UNSPECIFIED, try open for read-write, then for
read-only if open fails with EACCES, then for write-only
if that fails with EACCES again.
* io/unix.c (open_external): Document changed behavior of
regular_file.
testsuite/
* gfortran.dg/open_new.f90: New file.
From-SVN: r94076
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/open_new.f90 | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7115b35..b39fb69 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-01-22 Thomas Koenig <Thomas.Koenig@online.de> + + PR libfortran/18982 + * gfortran.dg/open_new.f90: New file. + 2005-01-22 Paul Brook <paul@codesourcery.com> * namelist_1.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/open_new.f90 b/gcc/testsuite/gfortran.dg/open_new.f90 new file mode 100644 index 0000000..9e9c951 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/open_new.f90 @@ -0,0 +1,11 @@ +! { dg do-run } +! PR 18982: verifies that opening an existing file with +! status="new" is an error +program main + nout = 10 + open(nout, file="foo.dat", status="replace") ! make sure foo.dat exists + close(nout) + open(nout, file="foo.dat", status="new",err=100) + call abort ! This should never happen +100 continue +end program main |