Re: [PATCH] Replacing the system call pread() with lseek()/xread()/lseek() sequence.
On Wed, 10 Jan 2007, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi,
>
> On Tue, 9 Jan 2007, Andy Whitcroft wrote:
>
> > Stefan-W. Hahn wrote:
> >
> > > + if (current_offset != lseek(fd, current_offset, SEEK_SET))
> > > + return -1;
> >
> > How likely are we ever to be in the right place here?
>
> You mean something like
>
> if (current_offset != offset + count &&
> current_offset != lseek(fd, current_offset, SEEK_SET))
> return -1;
>
> instead? Seems cheap enough.
In the index-pack case it simply will never happen.
Nicolas