summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 9dc49ed..d82cb6f 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -310,7 +310,8 @@ H5AC_compare (const void *_a, const void *_b)
*
* Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL if there was a request to flush all
+ * items and something was protected.
*
* Programmer: Robb Matzke
* matzke@llnl.gov
@@ -374,6 +375,14 @@ H5AC_flush (hdf5_file_t *f, const H5AC_class_t *type, haddr_t addr,
}
map = H5MM_xfree (map);
+ /*
+ * If there are protected object then fail. However, everything
+ * else should have been flushed.
+ */
+ if (f->cache->nprots>0) {
+ HRETURN_ERROR (H5E_CACHE, H5E_PROTECT, FAIL);
+ }
+
} else if ((!type || f->cache->slot[i].type==type) &&
f->cache->slot[i].addr==addr) {
/*
@@ -389,14 +398,6 @@ H5AC_flush (hdf5_file_t *f, const H5AC_class_t *type, haddr_t addr,
}
- /*
- * If there are protected objects then fail. However, everything
- * else should have been flushed.
- */
- if (f->cache->nprots>0) {
- HRETURN_ERROR (H5E_CACHE, H5E_PROTECT, FAIL);
- }
-
FUNC_LEAVE (SUCCEED);
}