summaryrefslogtreecommitdiffstats
path: root/worker/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'worker/util.h')
-rw-r--r--worker/util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/worker/util.h b/worker/util.h
index 618f68a..f3fee31 100644
--- a/worker/util.h
+++ b/worker/util.h
@@ -19,5 +19,19 @@ void debug_fn(const char *format, ...);
} \
} while(0)
+#define CHECK_NULL_RETURN(pointer, message) do { \
+ if (pointer == NULL) { \
+ DEBUG(0, message); \
+ return(-1); \
+ } \
+} while(0)
+
+#define CHECK_MINUS_ONE_RETURN(pointer, message) do { \
+ if (pointer == -1) { \
+ DEBUG(0, message); \
+ return(-1); \
+ } \
+} while(0)
+
#endif /* __WORKER_UTIL_H__ */