summaryrefslogtreecommitdiffstats
path: root/src/H5Pocpl.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2013-05-14 19:56:51 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2013-05-14 19:56:51 (GMT)
commit71af5b7480cb0f0aa689640972f8e96fef1e60f0 (patch)
treeab8e74253d276931a20d40a0df8a2de6692026fe /src/H5Pocpl.c
parent811ac68ac24972a1392fc9f6d20ae96286b2db7a (diff)
downloadhdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.zip
hdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.tar.gz
hdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.tar.bz2
[svn-r23702] Issue 8380 - H5Zunregister caused seg fault. This is a porting of code from the trunk. It fixes the problem by first iterating
through all opened datasets and groups to see if any of them uses the filter. If it finds one, the function fails with a message. Then the function flushes all opened files. Tested with h5committest.
Diffstat (limited to 'src/H5Pocpl.c')
-rw-r--r--src/H5Pocpl.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 2199b9c..0405197 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -1158,6 +1158,43 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5P_filter_in_pline
+ *
+ * Purpose: Check whether the filter is in the pipeline of the object
+ * creation property list.
+ *
+ * Return: TRUE: found
+ * FALSE: not found
+ * FAIL: error
+ *
+ * Programmer: Raymond Lu
+ * 14 May 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id)
+{
+ H5O_pline_t pline; /* Filter pipeline */
+ H5Z_filter_info_t *filter; /* Pointer to filter information */
+ htri_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Get pipeline info */
+ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline")
+
+ /* Check if the file is in the pipeline */
+ if((ret_value = H5Z_filter_in_pline(&pline, id)) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTCOMPARE, FAIL, "can't find filter")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5P_get_filter_by_id() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5Premove_filter
*
* Purpose: Deletes a filter from the dataset creation property list;