diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-11 21:52:12 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-11 21:52:12 (GMT) |
commit | bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617 (patch) | |
tree | 22d86206d90c12ad58a5406530ba73d49fa0c2a4 /src | |
parent | f8f9dac38a70f525248c3684e612edf1fa31c18a (diff) | |
download | hdf5-bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617.zip hdf5-bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617.tar.gz hdf5-bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617.tar.bz2 |
[svn-r22559] - move the vol plugin ref count increment for H5Freopen into the VOL layer
- fix a bug in H5VLdatatype_get_binary
Diffstat (limited to 'src')
-rw-r--r-- | src/H5F.c | 1 | ||||
-rw-r--r-- | src/H5VL.c | 2 | ||||
-rw-r--r-- | src/H5VLint.c | 6 |
3 files changed, 7 insertions, 2 deletions
@@ -779,7 +779,6 @@ H5Freopen(hid_t file_id) /* Get an atom for the file with the VOL information as the auxilary struct*/ if((ret_value = H5I_register2(H5I_FILE, file, vol_plugin, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") - vol_plugin->nrefs ++; done: FUNC_LEAVE_API(ret_value) @@ -708,7 +708,7 @@ H5VLdatatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size_ if (NULL == obj || NULL == vol_plugin || NULL == vol_plugin->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object/VOL class pointer") - if((ret_value = H5VL_datatype_get_binary(obj, vol_plugin, buf, size, req))) + if((ret_value = H5VL_datatype_get_binary(obj, vol_plugin, buf, size, req)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to encode datatype") done: diff --git a/src/H5VLint.c b/src/H5VLint.c index 5b427c2..08c539a 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -822,6 +822,7 @@ H5VL_datatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size /* call the corresponding VOL open callback */ if((ret_value = (vol_plugin->cls->datatype_cls.get_binary)(obj, buf, size, req)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "get binary failed") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_datatype_get_binary() */ @@ -1399,6 +1400,11 @@ H5VL_file_optional(void *file, H5VL_t *vol_plugin, H5VL_file_optional_t optional HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "optional failed") va_end (arguments); + /* if the get_type is a named datatype, attach the vol info to it */ + if(H5VL_FILE_REOPEN == optional_type) { + vol_plugin->nrefs ++; + } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_file_optional() */ |