diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-12-01 09:41:13 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-12-01 09:41:13 (GMT) |
commit | 5d7d029b97b36d1c380cef82d637342921bf3a1d (patch) | |
tree | 76ac3ff4b2240412995ef5902f62601dc9d529f1 /src/H5O.c | |
parent | 65be68a17d1e5bec7e51e5f3e2e03d22163f7817 (diff) | |
parent | 63bcd73f1f53a8b4bb31083cbc30f9a90663438f (diff) | |
download | hdf5-5d7d029b97b36d1c380cef82d637342921bf3a1d.zip hdf5-5d7d029b97b36d1c380cef82d637342921bf3a1d.tar.gz hdf5-5d7d029b97b36d1c380cef82d637342921bf3a1d.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~koziol/hdf5 into develop_swmr_merge
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1558,7 +1558,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_close(H5O_loc_t *loc) +H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1569,6 +1569,15 @@ H5O_close(H5O_loc_t *loc) HDassert(loc->file); HDassert(H5F_NOPEN_OBJS(loc->file) > 0); + /* Set the file_closed flag to the default value. + * This flag lets downstream code know if the file struct is + * still accessible and/or likely to contain useful data. + * It's needed by the evict-on-close code. Clients can ignore + * this value by passing in NULL. + */ + if(file_closed) + *file_closed = FALSE; + /* Decrement open-lock counters */ H5F_DECR_NOPEN_OBJS(loc->file); @@ -1589,7 +1598,7 @@ H5O_close(H5O_loc_t *loc) */ if(H5F_NOPEN_OBJS(loc->file) == H5F_NMOUNTS(loc->file)) /* Attempt to close down the file hierarchy */ - if(H5F_try_close(loc->file) < 0) + if(H5F_try_close(loc->file, file_closed) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") /* Release location information */ @@ -2713,7 +2722,7 @@ H5O_loc_free(H5O_loc_t *loc) H5F_DECR_NOPEN_OBJS(loc->file); loc->holding_file = FALSE; if(H5F_NOPEN_OBJS(loc->file) <= 0) { - if(H5F_try_close(loc->file) < 0) + if(H5F_try_close(loc->file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") } /* end if */ } /* end if */ |