From ef6364ad604bb90950befc88050144d49c431950 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Mon, 7 Nov 2011 14:32:50 +0000 Subject: Revert previous fix for PR 45723. libgfortran ChangeLog: 2011-11-07 Janne Blomqvist PR libfortran/45723 * io/open.c (new_unit): Don't check file size before attempting seek. testsuite ChangeLog: 2011-11-07 Janne Blomqvist PR libfortran/45723 * gfortran.dg/open_dev_null.F90: Remove testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@181085 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/open_dev_null.f90 | 9 --------- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/open.c | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 gcc/testsuite/gfortran.dg/open_dev_null.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 33c4955426b..2338c0af179 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-07 Janne Blomqvist + + PR libfortran/45723 + * gfortran.dg/open_dev_null.f90: Remove testcase. + 2011-11-07 Uros Bizjak * lib/target-supports.exp (check_effective_target_sync_int_128): diff --git a/gcc/testsuite/gfortran.dg/open_dev_null.f90 b/gcc/testsuite/gfortran.dg/open_dev_null.f90 deleted file mode 100644 index 00394cb55a6..00000000000 --- a/gcc/testsuite/gfortran.dg/open_dev_null.f90 +++ /dev/null @@ -1,9 +0,0 @@ -! { dg-do run } -! PR45723 opening /dev/null for appending writes fails -logical :: thefile -inquire(file="/dev/null",exist=thefile) -if (thefile) then - open(unit=7,file="/dev/null",position="append") - close(7) -endif -end diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 264f196d9df..82538422db4 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2011-11-07 Janne Blomqvist + + PR libfortran/45723 + * io/open.c (new_unit): Don't check file size before attempting + seek. + 2011-11-02 Rainer Orth * Makefile.am (AM_CPPFLAGS): Add diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 0102b9cf99f..8f969edb5e1 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -554,7 +554,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) if (flags->position == POSITION_APPEND) { - if (file_size (opp->file, opp->file_len) > 0 && sseek (u->s, 0, SEEK_END) < 0) + if (sseek (u->s, 0, SEEK_END) < 0) generate_error (&opp->common, LIBERROR_OS, NULL); u->endfile = AT_ENDFILE; } -- cgit v1.2.3