From: Luiz Capitulino Date: Wed, 1 Aug 2012 19:29:38 +0000 (-0300) Subject: error: add error_get_class() X-Git-Tag: v1.2.0-rc0~28^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea25fbca88b223877c45c776b6c0e17e0247439f;p=thirdparty%2Fqemu.git error: add error_get_class() Signed-off-by: Luiz Capitulino Reviewed-by: Markus Armbruster --- diff --git a/error.c b/error.c index 648706aa678..2d34cde654f 100644 --- a/error.c +++ b/error.c @@ -64,6 +64,11 @@ bool error_is_set(Error **errp) return (errp && *errp); } +ErrorClass error_get_class(const Error *err) +{ + return err->err_class; +} + const char *error_get_pretty(Error *err) { return err->msg; diff --git a/error.h b/error.h index 96787521526..114e24b34bf 100644 --- a/error.h +++ b/error.h @@ -35,6 +35,11 @@ void error_set(Error **err, ErrorClass err_class, const char *fmt, ...) GCC_FMT_ */ bool error_is_set(Error **err); +/* + * Get the error class of an error object. + */ +ErrorClass error_get_class(const Error *err); + /** * Returns an exact copy of the error passed as an argument. */