[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno may be clobber
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno may be clobbered |
Date: |
Tue, 26 Jul 2016 12:54:41 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/26/2016 12:44 PM, Sascha Silbe wrote:
> As a general policy, we want callers to save errno
> themselves. error_setg_internal() currently goes out of its way to
> preserve errno, so with the API documentation not mentioning it either
> way, callers might come to rely on the current behaviour of the
> implementation. Spell out that we don't want to make that promise.
Alternatively, we could explicitly document that we DO intend to
preserve errno, so that callers can rely on it. Libvirt went with that
approach (error-reporting functions that preserve errno are easier to
think about than functions which may clobber errno).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature