diff options
author | Martin Nagy <mnagy@redhat.com> | 2009-07-31 14:24:12 +0200 |
---|---|---|
committer | Martin Nagy <mnagy@redhat.com> | 2009-08-04 16:50:54 +0200 |
commit | c81addd0760ab5d6f692358dc771432ec0cd91be (patch) | |
tree | 8da943ea2fb2698930ad285fa84b63d35801d5fb /src/util.h | |
parent | 573182aa22cda2c0c7d25b99f79e967d53813d28 (diff) | |
download | ldap_driver-c81addd0760ab5d6f692358dc771432ec0cd91be.tar.gz ldap_driver-c81addd0760ab5d6f692358dc771432ec0cd91be.tar.xz ldap_driver-c81addd0760ab5d6f692358dc771432ec0cd91be.zip |
Add CHECK_NEXT() macro similar to CHECK()
The CHECK_NEXT() macro behaves exactly as the CHECK() macro, with the
difference that it jumps to the 'next' label. This is useful if we need
to cleanup after every loop cycle, but don't want to abort the whole
function if error is found.
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -21,8 +21,17 @@ #define _LD_UTIL_H_ #define CHECK(op) \ - do { result = (op); \ - if (result != ISC_R_SUCCESS) goto cleanup; \ + do { \ + result = (op); \ + if (result != ISC_R_SUCCESS) \ + goto cleanup; \ + } while (0) + +#define CHECK_NEXT(op) \ + do { \ + result = (op); \ + if (result != ISC_R_SUCCESS) \ + goto next; \ } while (0) #define CHECKED_MEM_ALLOCATE(m, target_ptr, s) \ |