From: Nicolas Pitre Date: Wed, 10 Jan 2007 00:59:49 GMT Subject: Re: [PATCH] Replacing the system call pread() with lseek()/xread()/lseek() sequence. Message-ID: In-Reply-To: On Wed, 10 Jan 2007, Johannes Schindelin wrote: > 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