qemu-devel
[Top][All Lists]
Advanced

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

Re: Questionable aspects of QEMU Error's design


From: Paolo Bonzini
Subject: Re: Questionable aspects of QEMU Error's design
Date: Thu, 2 Apr 2020 20:57:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 02/04/20 10:55, Markus Armbruster wrote:
> 
> When you return non-null/null or true/false on success/error, neglecting
> to document that in a function contract can perhaps be tolerated; you're
> using the return type the common, obvious way.  But when you return 0/-1
> or 0/-errno, please spell it out.  I've seen too many "Operation not
> permitted" that were actually -1 mistaken for -EPERM.

Hopefully that would be avoided by the usage of Error itself.

Paolo

> Also too many
> functions that return -1 for some failures and -errno for others.




reply via email to

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