summaryrefslogtreecommitdiffstats
path: root/src/H5FD.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FD.c')
-rw-r--r--src/H5FD.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 5919403..947854d 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -111,7 +111,7 @@ static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*o
* object and the file is closed and re-opened, the 'fileno' value will
* be different.
*/
-static unsigned long file_serial_no;
+static unsigned long H5FD_file_serial_no_g;
/* File driver ID class */
static const H5I_class_t H5I_VFL_CLS[1] = {{
@@ -176,7 +176,7 @@ H5FD_init_interface(void)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface")
/* Reset the file serial numbers */
- file_serial_no = 0;
+ H5FD_file_serial_no_g = 0;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -211,8 +211,8 @@ H5FD_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(H5_interface_initialize_g) {
- if((n=H5I_nmembers(H5I_VFL))!=0) {
- H5I_clear_type(H5I_VFL, FALSE, FALSE);
+ if(H5I_nmembers(H5I_VFL) > 0) {
+ (void)H5I_clear_type(H5I_VFL, FALSE, FALSE);
/* Reset the VFL drivers, if they've been closed */
if(H5I_nmembers(H5I_VFL)==0) {
@@ -232,14 +232,21 @@ H5FD_term_interface(void)
H5FD_mpio_term();
#endif /* H5_HAVE_PARALLEL */
} /* end if */
- } else {
- H5I_dec_type_ref(H5I_VFL);
+
+ n++; /*H5I*/
+ } /* end if */
+ else {
+ /* Destroy the VFL driver id group */
+ (void)H5I_dec_type_ref(H5I_VFL);
+ n++; /*H5I*/
+
+ /* Mark closed */
H5_interface_initialize_g = 0;
- n = 1; /*H5I*/
- }
- }
+ } /* end else */
+ } /* end if */
+
FUNC_LEAVE_NOAPI(n)
-}
+} /* end H5FD_term_interface() */
/*-------------------------------------------------------------------------
@@ -1003,11 +1010,11 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver")
/* Increment the global serial number & assign it to this H5FD_t object */
- if(++file_serial_no == 0) {
+ if(++H5FD_file_serial_no_g == 0) {
/* (Just error out if we wrap around for now...) */
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number")
} /* end if */
- file->fileno = file_serial_no;
+ file->fileno = H5FD_file_serial_no_g;
/* Start with base address set to 0 */
/* (This will be changed later, when the superblock is located) */