qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] dmg: use pread


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 2/3] dmg: use pread
Date: Tue, 11 May 2010 10:00:07 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]