summaryrefslogtreecommitdiff
path: root/server/util
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-07 12:59:17 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-11-09 13:50:30 -0500
commit47d61ca8db78e5976400dbe08f426c0985e6e801 (patch)
treeec74b9a683113660420ee0aca8f10122ea8eb475 /server/util
parent35d0b225578e179b8c21f1eee59fcf075eb1f692 (diff)
downloadsssd-47d61ca8db78e5976400dbe08f426c0985e6e801.tar.gz
sssd-47d61ca8db78e5976400dbe08f426c0985e6e801.tar.bz2
sssd-47d61ca8db78e5976400dbe08f426c0985e6e801.zip
Fix tevent_req error checking.
When possible using a macro that correctly deals with tstate
Diffstat (limited to 'server/util')
-rw-r--r--server/util/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/util/util.h b/server/util/util.h
index f13217e6..661bcebb 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -140,6 +140,18 @@ errno_t set_debug_file_from_fd(const int fd);
} while(0)
#endif
+#define TEVENT_REQ_RETURN_ON_ERROR(req) do { \
+ enum tevent_req_state TRROEstate; \
+ uint64_t TRROEerr; \
+ \
+ if (tevent_req_is_error(req, &TRROEstate, &TRROEerr)) { \
+ if (TRROEstate == TEVENT_REQ_USER_ERROR) { \
+ return TRROEerr; \
+ } \
+ return EIO; \
+ } \
+} while (0)
+
#include "util/dlinklist.h"
/* From debug.c */