summaryrefslogtreecommitdiffstats
path: root/src/H5Pocpl.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2013-04-29 19:23:04 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2013-04-29 19:23:04 (GMT)
commitbada3f7a86cb30b24fad3a24f88114861527ed58 (patch)
tree3f351f78649e966c2521c606082ad63e860e81c1 /src/H5Pocpl.c
parent029e143471397de6ddc204be0c21f0c04ee5f2e2 (diff)
downloadhdf5-bada3f7a86cb30b24fad3a24f88114861527ed58.zip
hdf5-bada3f7a86cb30b24fad3a24f88114861527ed58.tar.gz
hdf5-bada3f7a86cb30b24fad3a24f88114861527ed58.tar.bz2
[svn-r23656] Issue 8380 H5Zunregister caused seg fault: I added some protection measures:
1. If any opened object uses the filter, let it fail. 2. Flush all opened files to push any cached data to 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 880b46a..f80e4e7 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -1177,6 +1177,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
+ * 26 April 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;