Commit e1c74af0 by Bud Davis Committed by Bud Davis

re PR libfortran/18983 (can't open /dev/null as an output file)

2005-01-15  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18983
        * io/transfer.c (st_write_done): only truncate when it
        is required.

2005-01-15  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18983
        * gfortran.dg/write_to_null.f90: New test.

From-SVN: r93689
parent 6a29dc8b
2005-01-15 Bud Davis <bdavis9659@comcast.net>
PR fortran/18983
* gfortran.dg/write_to_null.f90: New test.
2005-01-14 Andrew Pinski <pinskia@physics.uc.edu>
John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
......
! { dg-do run }
! pr18983
! could not write to /dev/null
integer i
open(10,file="/dev/null")
do i = 1,100
write(10,*) "Hello, world"
end do
end
2005-01-15 Bud Davis <bdavis9659@comcast.net>
PR fortran/18983
* io/transfer.c (st_write_done): only truncate when it
is required.
2005-01-12 Toon Moene <toon@moene.indiv.nluug.nl>
PR libfortran/19280
......
......@@ -1557,9 +1557,13 @@ st_write_done (void)
current_unit->endfile = AT_ENDFILE; /* Just at it now. */
break;
case NO_ENDFILE: /* Get rid of whatever is after this record. */
if (struncate (current_unit->s) == FAILURE)
generate_error (ERROR_OS, NULL);
case NO_ENDFILE:
if (current_unit->current_record > current_unit->last_record)
{
/* Get rid of whatever is after this record. */
if (struncate (current_unit->s) == FAILURE)
generate_error (ERROR_OS, NULL);
}
current_unit->endfile = AT_ENDFILE;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment