qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 25/41] buffered_file: make buffered_flush return


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 25/41] buffered_file: make buffered_flush return the error code
Date: Tue, 02 Oct 2012 13:16:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

Il 02/10/2012 13:06, Juan Quintela ha scritto:
>> Perhaps the other way round:
>> >
>> >     if (ret < 0) {
>> >         ret2 = -1;
>> >     }
>> >     ...
>> >     return ret2;
> This lost the 1st errno value.

Right, I meant ret2 = ret;

> The other way around we preserve it.

I think with "ret2 = ret;" it is the same.

The way you have it in your patch, you could truncate a positive ssize_t
return value from buffered_flush that does not fit in an int.
Theoretical, I know, but I can see Coverity spotting it from a mile...

Paolo



reply via email to

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