summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2001-12-11 19:53:44 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2001-12-11 19:53:44 (GMT)
commitd28fd08f4a9593bd8bb51ebc17b8b6555b3885cd (patch)
tree61e5d32198fc92bdfb2b98115269991f3fadd53b /src/H5I.c
parent33ed41455eff31751d3d9d635140996ebbc61a4e (diff)
downloadhdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.zip
hdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.tar.gz
hdf5-d28fd08f4a9593bd8bb51ebc17b8b6555b3885cd.tar.bz2
[svn-r4696]
Purpose: Modify H5Fclose behavior Description: The HDF5 actual file close behaves in several ways in terms of if there are still objects(dataset, group, datatype) opened in file. Solution: Added a new file access property, file close degree. It has four values, H5F_CLOSE_DEFAULT H5F_CLOSE_WEAK H5F_CLOSE_SEMI H5F_CLOSE_STRONG The way a file is closed is decided by these values. Platforms tested: IRIX64 6.5, SunOS 5.6, FreeBSD 4.4
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5I.c b/src/H5I.c
index 6f58e09..65815a4 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -888,6 +888,11 @@ H5I_remove(hid_t id)
* removed from the group and its reference count is not decremented.
* The group number is now passed to the free method.
*
+ * Raymond, 11 Dec 2001
+ * If the freeing function fails, return failure instead of reference
+ * count 1. This feature is needed by file close with H5F_CLOSE_SEMI
+ * value.
+ *
*-------------------------------------------------------------------------
*/
int
@@ -924,7 +929,7 @@ H5I_dec_ref(hid_t id)
H5I_remove(id);
ret_value = 0;
} else {
- ret_value = 1;
+ ret_value = FAIL;
}
} else {
ret_value = --(id_ptr->count);
@@ -1020,7 +1025,7 @@ H5I_search(H5I_type_t grp, H5I_search_func_t func, const void *key)
for (i=0; i<grp_ptr->hash_size; i++) {
id_ptr = grp_ptr->id_list[i];
while (id_ptr) {
- if ((*func)(id_ptr->obj_ptr, key)) {
+ if ((*func)(id_ptr->obj_ptr, id_ptr->id, key)) {
HGOTO_DONE(id_ptr->obj_ptr); /*found the item*/
}
id_ptr = id_ptr->next;