Loading error.c +13 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,19 @@ void error_set(Error **errp, const char *fmt, ...) *errp = err; } Error *error_copy(const Error *err) { Error *err_new; err_new = g_malloc0(sizeof(*err)); err_new->msg = g_strdup(err->msg); err_new->fmt = err->fmt; err_new->obj = err->obj; QINCREF(err_new->obj); return err_new; } bool error_is_set(Error **errp) { return (errp && *errp); Loading error.h +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,11 @@ void error_set(Error **err, const char *fmt, ...) GCC_FMT_ATTR(2, 3); */ bool error_is_set(Error **err); /** * Returns an exact copy of the error passed as an argument. */ Error *error_copy(const Error *err); /** * Get a human readable representation of an error object. */ Loading Loading
error.c +13 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,19 @@ void error_set(Error **errp, const char *fmt, ...) *errp = err; } Error *error_copy(const Error *err) { Error *err_new; err_new = g_malloc0(sizeof(*err)); err_new->msg = g_strdup(err->msg); err_new->fmt = err->fmt; err_new->obj = err->obj; QINCREF(err_new->obj); return err_new; } bool error_is_set(Error **errp) { return (errp && *errp); Loading
error.h +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,11 @@ void error_set(Error **err, const char *fmt, ...) GCC_FMT_ATTR(2, 3); */ bool error_is_set(Error **err); /** * Returns an exact copy of the error passed as an argument. */ Error *error_copy(const Error *err); /** * Get a human readable representation of an error object. */ Loading