summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-24 05:50:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-24 05:50:00 (GMT)
commitb0980a5f5418dcfabb442592d82eebb625dc6220 (patch)
tree03f5cda6d273681f481c5283593c397a30eab311 /src/H5T.c
parent3ac0a74bf3396fc684df961add72b6a80c56ae75 (diff)
downloadhdf5-b0980a5f5418dcfabb442592d82eebb625dc6220.zip
hdf5-b0980a5f5418dcfabb442592d82eebb625dc6220.tar.gz
hdf5-b0980a5f5418dcfabb442592d82eebb625dc6220.tar.bz2
[svn-r29776] Description:
Bring "file pointer patching" code & test from revise_chunks to trunk. Tested on: MacOSX/64 10.11.4 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 1e9cdc6..765df7a 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -5453,3 +5453,32 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_patch_file() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5T_patch_vlen_file
+ *
+ * Purpose: Patch the top-level file pointer contained in (dt->shared->u.vlen.f)
+ * to point to f. This is possible because
+ * the top-level file pointer can be closed out from under
+ * dt while dt is contained in the shared file's cache.
+ *
+ * Return: SUCCEED
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5T_patch_vlen_file(H5T_t *dt, H5F_t *f)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /* Sanity check */
+ HDassert(dt);
+ HDassert(dt->shared);
+ HDassert(f);
+
+ if((dt->shared->type == H5T_VLEN) && dt->shared->u.vlen.f != f)
+ dt->shared->u.vlen.f = f;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5T_patch_vlen_file() */
+