summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-08-21 19:45:36 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-08-21 19:45:36 (GMT)
commit18d574106c5eaeb7addd6fa6b28d5197cedce992 (patch)
tree71b66031947de38674867f1826f60a8c872eb1d8 /src/H5Fint.c
parent60d3b3091764c2ec9bede45aeacb6b2da1fa22d8 (diff)
parente53af0ed745a7bec1795681c473ba54025814fd5 (diff)
downloadhdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.zip
hdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.tar.gz
hdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.tar.bz2
[svn-r22704] merge from trunk up to 22703.
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 65b5b08..538a22a 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -608,7 +608,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_is_hdf5() */
-
/*-------------------------------------------------------------------------
* Function: H5F_new
*
@@ -808,13 +807,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 */
@@ -832,6 +833,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 */