error: error_setg_errno(): errno gets preserved
commit98cb89af4df7e1776ce418ed6167b6e214a64435
authorSascha Silbe <silbe@linux.vnet.ibm.com>
Wed, 27 Jul 2016 09:24:26 +0000 (27 11:24 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 19 Jan 2017 14:42:36 +0000 (19 15:42 +0100)
tree74adf13f9d5de181f8915010411398d19fe3229c
parentab4b92760498e097ff668f0e9c83aa87a2ec1128
error: error_setg_errno(): errno gets preserved

C11 allows errno to be clobbered by pretty much any library function
call, so in general callers need to take care to save errno before
calling other functions.

However, for error reporting functions this is rather awkward and can
make the code on the caller side more complicated than
necessary. error_setg_errno() already takes care of preserving errno
and some functions rely on that, so just promise that we continue to
do so in the future.

Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Message-Id: <1469611466-31574-1-git-send-email-silbe@linux.vnet.ibm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
include/qapi/error.h