Re: [PATCH] Replacing the system call pread() with lseek()/xread()/lseek() sequence.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 9, 2007, 23:42 UTC
- Message-ID
- <Pine.LNX.4.63.0701100041310.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <45A40C15.1070200@shadowen.org>
Hi,
On Tue, 9 Jan 2007, Andy Whitcroft wrote:
Show 6 quoted lines
> 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.
Ciao, Dscho