summaryrefslogtreecommitdiffstats
path: root/src/H5G.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/H5G.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/H5G.c')
-rw-r--r--src/H5G.c50
1 files changed, 41 insertions, 9 deletions
diff --git a/src/H5G.c b/src/H5G.c
index a0e7767..1bd98a6 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -495,22 +495,54 @@ done:
hid_t
H5Gget_create_plist(hid_t group_id)
{
+ H5G_t *group = NULL;
+ hid_t ret_value = FAIL;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE1("i", "i", group_id);
+
+ /* Check args */
+ if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+
+ if((ret_value = H5G_get_create_plist(group)) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Gget_create_plist() */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_get_create_plist
+ *
+ * Purpose: Private function for H5Gget_create_plist
+ *
+ * Return: Success: ID for a copy of the group creation
+ * property list. The property list ID should be
+ * released by calling H5Pclose().
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, October 25, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5G_get_create_plist(H5G_t *grp)
+{
H5O_linfo_t linfo; /* Link info message */
htri_t ginfo_exists;
htri_t linfo_exists;
htri_t pline_exists;
- H5G_t *grp = NULL;
H5P_genplist_t *gcpl_plist;
H5P_genplist_t *new_plist;
hid_t new_gcpl_id = FAIL;
hid_t ret_value = FAIL;
- FUNC_ENTER_API(FAIL)
- H5TRACE1("i", "i", group_id);
-
- /* Check args */
- if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ FUNC_ENTER_NOAPI(FAIL)
/* Copy the default group creation property list */
if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_g)))
@@ -573,8 +605,8 @@ done:
HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free")
} /* end if */
- FUNC_LEAVE_API(ret_value)
-} /* end H5Gget_create_plist() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_get_create_plist() */
/*-------------------------------------------------------------------------