diff mbox

[1/9] error: add error_setg()

Message ID 1346269986-13539-2-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino Aug. 29, 2012, 7:52 p.m. UTC
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 error.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/error.h b/error.h
index 96fc203..da7fed3 100644
--- a/error.h
+++ b/error.h
@@ -30,6 +30,12 @@  typedef struct Error Error;
 void error_set(Error **err, ErrorClass err_class, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
 
 /**
+ * Same as error_set(), but sets a generic error
+ */
+#define error_setg(err, fmt, ...) \
+    error_set(err, ERROR_CLASS_GENERIC_ERROR, fmt, ## __VA_ARGS__)
+
+/**
  * Returns true if an indirect pointer to an error is pointing to a valid
  * error object.
  */