summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-10-31 18:48:35 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-10-31 18:48:35 (GMT)
commit7948d9eb2667d9040b4d959198648143b7f1f9e4 (patch)
treee4533a1c3c9a0df0c07266d679165d186c79bf51 /src/H5I.c
parent7ef1503d40737e15eab74aee5ba7d25aa8e58ace (diff)
downloadhdf5-7948d9eb2667d9040b4d959198648143b7f1f9e4.zip
hdf5-7948d9eb2667d9040b4d959198648143b7f1f9e4.tar.gz
hdf5-7948d9eb2667d9040b4d959198648143b7f1f9e4.tar.bz2
[svn-r7801] Purpose: added feature
Description: more feature to H5Iget_file_id(). If file ID is closed, it can still return an ID given object ID. Platforms tested: h5committest
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5I.c b/src/H5I.c
index 4af50a1..c2ee0ea 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -117,7 +117,6 @@ H5FL_DEFINE_STATIC(H5I_id_info_t);
/*--------------------- Local function prototypes ---------------------------*/
static herr_t H5I_init_interface(void);
static H5I_id_info_t *H5I_find_id(hid_t id);
-static hid_t H5I_get_file_id(hid_t obj_id);
#ifdef H5I_DEBUG_OUTPUT
static herr_t H5I_debug(H5I_type_t grp);
#endif /* H5I_DEBUG_OUTPUT */
@@ -843,7 +842,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static hid_t
+hid_t
H5I_get_file_id(hid_t obj_id)
{
H5G_entry_t *ent;
@@ -855,6 +854,11 @@ H5I_get_file_id(hid_t obj_id)
switch(H5I_GRP(obj_id)) {
case H5I_FILE:
ret_value = obj_id;
+
+ /* Increment reference count on atom. */
+ if (H5I_inc_ref(ret_value)<0)
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed");
+
break;
case H5I_DATATYPE:
@@ -875,10 +879,6 @@ H5I_get_file_id(hid_t obj_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID");
}
- /* Increment reference count on atom. */
- if (H5I_inc_ref(ret_value)<0)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed");
-
done:
FUNC_LEAVE_NOAPI(ret_value);
}