diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2012-07-25 21:50:22 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2012-07-25 21:50:22 (GMT) |
commit | c04144fb39b6d7a489c37e89ac8a0240991026a6 (patch) | |
tree | 8f2d927263672bd7b524673a8943d1a982a8a470 /src/H5Eprivate.h | |
parent | b5ef63b550d4d1149aebb0c46aebc7df672427aa (diff) | |
download | hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.zip hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.tar.gz hdf5-c04144fb39b6d7a489c37e89ac8a0240991026a6.tar.bz2 |
[svn-r22601] Purpose: Fix HDFFV-5853
Description:
When jumping out from between H5_BEGIN_TAG and H5_END_TAG macros using
HGOTO_ERROR or HGOTO_DONE, the previous metadata tag is not reset on the dxpl.
This could cause problems when, for example, calling H5Ocopy within an
H5Literate callback.
Added new HGOTO_ERROR_TAG and HGOTO_DONE_TAG macros which must be used in place
of the above between H5_BEGIN_TAG and H5_END_TAG.
Tested:
jam, koala, ostrich (h5committest), durandal
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 2ca48d2..b2ca5eb 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -69,6 +69,17 @@ typedef struct H5E_t H5E_t; } /* + * HGOTO_ERROR_TAG macro, used like HGOTO_ERROR between H5_BEGIN_TAG and + * H5_END_TAG statements. Resets the metadata tag before leaving the function. + */ +#define HGOTO_ERROR_TAG(maj, min, ret_val, ...) { \ + if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ + HERROR(H5E_CACHE, H5E_CANTTAG, "unable to apply metadata tag"); \ + HCOMMON_ERROR(maj, min, __VA_ARGS__); \ + HGOTO_DONE(ret_val) \ +} + +/* * HGOTO_DONE macro, used to facilitate normal return between a FUNC_ENTER() * and a FUNC_LEAVE() within a function body. The argument is the return * value which is assigned to the `ret_value' variable. Control branches to @@ -77,6 +88,16 @@ typedef struct H5E_t H5E_t; #define HGOTO_DONE(ret_val) {ret_value = ret_val; goto done;} /* + * HGOTO_DONE_TAG macro, used like HGOTO_DONE between H5_BEGIN_TAG and + * H5_END_TAG statements. Resets the metadata tag before leaving the function. + */ +#define HGOTO_DONE_TAG(ret_val, err) { \ + if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + HGOTO_DONE(ret_val) \ +} + +/* * Macros handling system error messages as described in C standard. * These macros assume errnum is a valid system error code. */ |