From: Tomash Brechko Date: Fri, 27 Jul 2007 10:33:15 GMT Subject: Re: index-pack died on pread Message-ID: <20070727103315.GB5047@moonlight.home> In-Reply-To: <20070727095013.GA5047@moonlight.home> On Fri, Jul 27, 2007 at 13:50:13 +0400, Tomash Brechko wrote: > There's no dup() call, so when we mess pack_fd (that is used in > pread() only), we also mess one more file descriptor that is used > sequentially (output_fd in my case), and so may corrupt the pack. I was wrong on the dup() part, since dup()'ed descriptors share the same file position. Anyway, if my guess is right, the fix would probably be not to use broken pread() that messes file position, rather than to be ready and workaround that. -- Tomash Brechko