[Patch, libgfortran] READ from the terminal is broken.

Janne Blomqvist jblomqvi@cc.hut.fi
Wed Oct 12 11:36:00 GMT 2005


On Wed, Oct 12, 2005 at 01:01:19PM +0200, Paul Thomas wrote:
> :ADDPATCH fortran:
> 
> >If this works consider the patch OK:d from me. The rest of my patch
> >should work as before despite this change, as after this the only
> >place where do_read() is used is for big unformatted reads, which
> >obviously don't suffer from weird interactions with the terminal.
> >
> I applied the correction that you proposed.  Could you make sure that it 
> is as intended, please?

Aw sorry, it seems I copy-pasted a few lines too much in my previous
mail. I think this last part that changes fd_seek() is unnecessary:

> *** 548,562 ****
>  }
> 
> 
> ! static try
>  fd_seek (unix_stream * s, gfc_offset offset)
>  {
> -   if (s->physical_offset == offset) /* Are we lucky and avoid syscall?  */
> -     {
> -       s->logical_offset = offset;
> -       return SUCCESS;
> -     }
> -
>    s->physical_offset = s->logical_offset = offset;
> 
>    return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS;
> --- 548,556 ----
>  }
> 
> 
> ! static int
>  fd_seek (unix_stream * s, gfc_offset offset)
>  {
>    s->physical_offset = s->logical_offset = offset;
> 
>    return (lseek (s->fd, offset, SEEK_SET) < 0) ? FAILURE : SUCCESS;
> 

-- 
Janne Blomqvist



More information about the Gcc-patches mailing list