]> xenbits.xensource.com Git - libvirt.git/commit
Preserve errno across calls to error reporting functions & VIR_FREE
authorLaine Stump <laine@laine.org>
Thu, 23 Dec 2010 18:23:42 +0000 (13:23 -0500)
committerLaine Stump <laine@laine.org>
Thu, 23 Dec 2010 21:48:16 +0000 (16:48 -0500)
commit17e19adde20d8f7907161588aaeee21777fa4091
tree360c38faf5f2eb47110ed756d1f7600e2ce4df93
parent8090a56890457b192ff453a65f220c4b6617dc27
Preserve errno across calls to error reporting functions & VIR_FREE

There are cases when we want log an error message, and possibly free
some memory as part of the cleanup, while still preserving errno for a
caller, but the functions that log errors, and virFree (VIR_FREE) make
system calls that will clear errno. This patch preserves errno during
those most basic functions (corresponding to virReportSystemError(),
virReportOOMError(), networkReportError(), etc, as well as
virStrError()). It does *not preserve errno across calls to higher
level items such as virDispatchError(), as it's assumed the caller is
all finished with any need for errno by the time it dispatches the
error.
src/util/memory.c
src/util/virterror.c