summaryrefslogtreecommitdiff
path: root/daemon/usuals.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/usuals.h')
-rw-r--r--daemon/usuals.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/daemon/usuals.h b/daemon/usuals.h
index 020db4a..b97c85d 100644
--- a/daemon/usuals.h
+++ b/daemon/usuals.h
@@ -30,6 +30,16 @@
#define RETURN(x) { ret = (x); goto finally; }
+/*
+ * To be used like this:
+ * if(CHECK_BUF(b))
+ * return HA_CRITERROR;
+ */
+
+#define CHECK_BUF(b) (ha_buferr(b) ? (ha_memerr(NULL), 1) : 0)
+#define CHECK_RBUF(rq) (ha_buferr((rq)->buf) ? (ha_memerr(rq), 1) : 0)
+
+
#ifdef _DEBUG
#include "assert.h"
#define ASSERT assert