This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] patch for pr15472 and sequential unformatted I/O
> went over the logic (executed with printf's in the code!) both
> with a terminal device and a fifo. both give error messages when
> seeks are attempted, and s->file_length is not overwritten.
>
> test results unchanged. no test suite failures i686/gnu/linux.
>
> --bud
>
>
> Index: unix.c
> ===================================================================
<...>
> ! /* don't increment file_length if the file is non-seekable */
> ! if (s->file_length != -1 )
> ! if (s->physical_offset > s->file_length)
> ! s->file_length = s->physical_offset;
> s->ndirty = 0;
Coding conventions require braces for the outer if statement.
The second if is superfluous, ie.
if (s->file_length != -1 && s->physical_offset > s->file_length)
Ok with that change (don't forget the ChangeLog).
Paul