From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34975 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBkY1-0002Dy-EO for qemu-devel@nongnu.org; Tue, 11 May 2010 04:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBkOJ-0000sG-1y for qemu-devel@nongnu.org; Tue, 11 May 2010 04:00:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58452) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBkOI-0000rx-Ke for qemu-devel@nongnu.org; Tue, 11 May 2010 04:00:35 -0400 Message-ID: <4BE90E87.3090206@redhat.com> Date: Tue, 11 May 2010 10:00:07 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/3] dmg: use pread References: <20100507145519.GA14157@lst.de> <20100507145603.GB14245@lst.de> <4BE7DAEC.4090405@redhat.com> <20100510202022.GA26186@lst.de> In-Reply-To: <20100510202022.GA26186@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Am 10.05.2010 22:20, schrieb Christoph Hellwig: > On Mon, May 10, 2010 at 12:07:40PM +0200, Kevin Wolf wrote: >>> + if (type == 0x6d697368 && count >= 244) { >>> int new_size, chunk_count; >>> - if(lseek(s->fd,200,SEEK_CUR)<0) >>> - goto fail; >>> + >>> + offset += 4; >> >> Isn't this needed in the else case, too? > > I don't think so. For that case we previously did a > > lseek(s->fd,count-4,SEEK_CUR) > > to undo the 4 byte advance done by the read. You're right. Somehow I completely missed the original then branch and that you changed the condition. Kevin