diff options
-rw-r--r-- | src/H5F.c | 9 | ||||
-rw-r--r-- | src/H5FDcore.c | 3 | ||||
-rw-r--r-- | test/tfile.c | 2 |
3 files changed, 10 insertions, 4 deletions
@@ -2046,8 +2046,13 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) else shared->fc_degree = fc_degree; } else if(shared->nrefs > 1) { - if(fc_degree != shared->fc_degree) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match"); + if(fc_degree==H5F_CLOSE_DEFAULT) { + if(shared->fc_degree != H5F_CLOSE_DEFAULT && shared->fc_degree!=shared->lf->cls->fc_degree) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match"); + } else { + if(fc_degree != shared->fc_degree) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match"); + } } /* Success */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index cb36223..cea3834 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -85,6 +85,7 @@ static haddr_t H5FD_core_get_eoa(H5FD_t *_file); static herr_t H5FD_core_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_core_get_eof(H5FD_t *_file); static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); +static H5F_close_degree_t H5FD_core_get_fc_degree(H5FD_t *_file); static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, @@ -652,7 +653,7 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) done: FUNC_LEAVE(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5FD_core_read diff --git a/test/tfile.c b/test/tfile.c index 07f8976..27b3601 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -511,7 +511,7 @@ test_file_close(void) fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); VERIFY(fid2, FAIL, "H5Fopen"); - ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK); + ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT); CHECK(ret, FAIL, "H5Pset_fclose_degree"); /* should succeed */ |