On 09/10/2012 02:26 AM, Wenchao Xia wrote: > This patch contains error handling APIs, which user could call them to > get error details. > > Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> > --- > libqblock/libqblock-error.c | 60 > +++++++++++++++++++++++++++++++++++++++++++ > libqblock/libqblock-error.h | 50 +++++++++++++++++++++++++++++++++++ > 2 files changed, 110 insertions(+), 0 deletions(-) > create mode 100644 libqblock/libqblock-error.c > create mode 100644 libqblock/libqblock-error.h
Again, this should come earlier in the series, and I'm focusing on the .h as a potential user, rather than on the .c. > + default: > + err_ret_str = "Unknow error."; s/Unknow/Unknown/ > +++ b/libqblock/libqblock-error.h > +/** > + * qb_error_get_errno: get error number, only valid when err_ret is > + * QB_ERR_INTERNAL_ERR. > + * > + * return negative errno or 0 if last error is not QB_ERR_INTERNAL_ERR. So does this return EINVAL or -EINVAL? If you return positive errno values, then you can reserve 0 for no error, and a QB_*-specific negative value in the case where QB_ERR_INTERNAL_ERR was not the last error. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature