summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2012-09-05 18:13:15 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2012-09-05 18:13:15 (GMT)
commit9ce6dadd4848ad1371d32f99d320efa87de32050 (patch)
tree1d301a6b3b50dda6b3f9490291c96c9cc0ec1f77 /src/H5F.c
parent60daa9be2b660c4583f581c85ea2177b060c4fcb (diff)
parent1c9e159ffe6cf85a5c076f747758dc47eb7a111a (diff)
downloadhdf5-9ce6dadd4848ad1371d32f99d320efa87de32050.zip
hdf5-9ce6dadd4848ad1371d32f99d320efa87de32050.tar.gz
hdf5-9ce6dadd4848ad1371d32f99d320efa87de32050.tar.bz2
[svn-r22739] ported revisions 22615 to 22737 from the trunk
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index b1f052d..d864e88 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1051,13 +1051,15 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
* Only try to flush the file if it was opened with write access, and if
* the caller requested a flush.
*/
- if((f->shared->flags & H5F_ACC_RDWR) && flush)
+ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush)
if(H5F_flush(f, dxpl_id, TRUE) < 0)
+ /* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
/* Release the external file cache */
if(f->shared->efc) {
if(H5F_efc_destroy(f->shared->efc) < 0)
+ /* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't destroy external file cache")
f->shared->efc = NULL;
} /* end if */
@@ -1075,6 +1077,14 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
if(H5MF_close(f, dxpl_id) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info")
+
+ /* Flush the file again (if requested), as shutting down the
+ * free space manager may dirty some data structures again.
+ */
+ if(flush)
+ if(H5F_flush(f, dxpl_id, TRUE) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
/* Unpin the superblock, since we're about to destroy the cache */