summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-29 18:46:19 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-29 18:46:19 (GMT)
commit4094dc843f1d42c71f4239e084e640454430ce3a (patch)
tree36b88358507430f973675defbeb2cf12e2a1a227 /src/H5F.c
parent871d377e65de92637507295a05f67d52167e2af8 (diff)
downloadhdf5-4094dc843f1d42c71f4239e084e640454430ce3a.zip
hdf5-4094dc843f1d42c71f4239e084e640454430ce3a.tar.gz
hdf5-4094dc843f1d42c71f4239e084e640454430ce3a.tar.bz2
[svn-r25488] - fix bug with H5Fget_access_plist. need to set VOL and VOL info in property
- add tests for H5Fis_accessible in vfd tests to make sure it works with different fapls. - fix bug in Log VFD driver.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/H5F.c b/src/H5F.c
index b2a1b55..dbef722 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -247,23 +247,38 @@ hid_t
H5Fget_access_plist(hid_t file_id)
{
H5VL_t *vol_plugin;
- void *obj;
- hid_t ret_value; /* Return value */
+ void *file;
+ void *vol_info = NULL;
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
+ hid_t fapl_id = FAIL, ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", file_id);
/* get the file object */
- if(NULL == (obj = (void *)H5I_object(file_id)))
+ if(NULL == (file = (void *)H5I_object(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
/* get the plugin pointer */
if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(file_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information")
- if(H5VL_file_get(obj, vol_plugin, H5VL_FILE_GET_FAPL, H5AC_dxpl_id, H5_EVENT_STACK_NULL, &ret_value) < 0)
+ if(H5VL_file_get(file, vol_plugin, H5VL_FILE_GET_FAPL, H5AC_dxpl_id,
+ H5_EVENT_STACK_NULL, &fapl_id, &vol_info) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file creation properties")
+ /* Set the vol properties for the list */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(fapl_id, H5I_GENPROP_LST)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+ if(H5P_set_vol(plist, vol_plugin->cls, vol_info) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vol")
+
+ ret_value = fapl_id;
+
done:
+ if(ret_value < 0 && fapl_id != FAIL)
+ if(H5I_dec_ref(fapl_id) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "decrementing plist ID failed")
+
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_access_plist() */