diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2017-06-30 07:55:45 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2017-06-30 07:55:45 (GMT) |
commit | 5262b98b34067c1aad30cb25f8e935711638f2c1 (patch) | |
tree | 2c3a723df5ab9ec5eecd2c5dfb195e680adc883f /src | |
parent | dba4a60413f5e7350b02bfe18aecab2d1b0e2b7a (diff) | |
parent | 804a88fafdca3d6a76312ab01ac4d6d5b103e9dc (diff) | |
download | hdf5-5262b98b34067c1aad30cb25f8e935711638f2c1.zip hdf5-5262b98b34067c1aad30cb25f8e935711638f2c1.tar.gz hdf5-5262b98b34067c1aad30cb25f8e935711638f2c1.tar.bz2 |
Merge pull request #586 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:develop to develop
* commit '804a88fafdca3d6a76312ab01ac4d6d5b103e9dc':
Fix for HDFFV-10160 Modifications to fix the assertion/abort failure when the application does not close the file.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 7 | ||||
-rw-r--r-- | src/H5FSint.c | 26 | ||||
-rw-r--r-- | src/H5FSprivate.h | 3 |
3 files changed, 36 insertions, 0 deletions
@@ -29,6 +29,7 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ #include "H5Tprivate.h" /* Datatypes */ +#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ @@ -204,6 +205,10 @@ H5_init_library(void) * property classes. * The link interface needs to be initialized so that link property lists * have their properties registered. + * The FS module needs to be initialized as a result of the fix for HDFFV-10160: + * It might not be initialized during normal file open. + * When the application does not close the file, routines in the module might + * be called via H5_term_library() when shutting down the file. */ if(H5E_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize error interface") @@ -217,6 +222,8 @@ H5_init_library(void) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize metadata caching interface") if(H5L_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize link interface") + if(H5FS_init() < 0) + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") /* Debugging? */ H5_debug_mask("-all"); diff --git a/src/H5FSint.c b/src/H5FSint.c index 1a41172..4297291 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -77,6 +77,32 @@ /*******************/ +/*------------------------------------------------------------------------- + * Function: H5FS_init + * + * Purpose: Initialize the interface in case it is unable to initialize + * itself soon enough. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * Saturday, March 4, 2000 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FS_init(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + /* FUNC_ENTER() does all the work */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FS_init() */ + /*------------------------------------------------------------------------- * Function: H5FS__create_flush_depend diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index c0467a6..247d75c 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -175,6 +175,9 @@ H5FL_SEQ_EXTERN(H5FS_section_class_t); /* Library-private Function Prototypes */ /***************************************/ +/* Package initialization routine */ +H5_DLL herr_t H5FS_init(void); + /* Free space manager routines */ H5_DLL H5FS_t *H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t nclasses, |