diff options
-rw-r--r-- | src/H5F.c | 6 | ||||
-rw-r--r-- | src/H5Gprivate.h | 1 | ||||
-rw-r--r-- | src/H5I.c | 3 | ||||
-rw-r--r-- | src/H5Iprivate.h | 1 |
4 files changed, 5 insertions, 6 deletions
@@ -4186,9 +4186,8 @@ done: /*------------------------------------------------------------------------- * Function: H5F_get_id * - * Purpose: Quick and dirty routine to retrieve the file's 'file id' - * (Mainly added to stop non-file routines from poking about - * in the H5F_t data structure) + * Purpose: Get the file ID, incrementing it, or "resurrecting" it as + * appropriate. * * Return: Non-negative on success/Negative on failure * @@ -4206,6 +4205,7 @@ H5F_get_id(H5F_t *file) FUNC_ENTER_NOINIT(H5F_get_id) assert(file); + if(file->file_id == -1) { if(H5I_remove(file->closing)==NULL) HGOTO_ERROR(H5E_ATOM, H5E_READERROR, FAIL, "unable to remove from closing list") diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index b2bff6c..2bf2c3f 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -38,7 +38,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Bprivate.h" /* B-trees */ #include "H5Fprivate.h" /* File access */ -#include "H5Gprivate.h" /* Group */ #include "H5RSprivate.h" /* Reference-counted strings */ /* @@ -117,6 +117,7 @@ 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 */ @@ -842,7 +843,7 @@ done: * *------------------------------------------------------------------------- */ -hid_t +static hid_t H5I_get_file_id(hid_t obj_id) { H5G_entry_t *ent; diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 42369e3..79819a5 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -67,7 +67,6 @@ H5_DLL hid_t H5I_register(H5I_type_t grp, void *object); H5_DLL void *H5I_object(hid_t id); H5_DLL void *H5I_object_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5I_get_type(hid_t id); -H5_DLL hid_t H5I_get_file_id(hid_t obj_id); H5_DLL void *H5I_remove(hid_t id); H5_DLL void *H5I_search(H5I_type_t grp, H5I_search_func_t func, void *key); H5_DLL int H5I_inc_ref(hid_t id); |