summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-06-06 18:11:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-06-06 18:11:10 (GMT)
commitf3abf1f3457a879ae698fecce4da16aeb9dc1734 (patch)
tree1ccb4485abfbf035f2061a7189c601983552837e /src/H5AC.c
parent4d16bcfecbf51574e3f8bb8cd0e50373892fa462 (diff)
downloadhdf5-f3abf1f3457a879ae698fecce4da16aeb9dc1734.zip
hdf5-f3abf1f3457a879ae698fecce4da16aeb9dc1734.tar.gz
hdf5-f3abf1f3457a879ae698fecce4da16aeb9dc1734.tar.bz2
[svn-r2342] Updated H5AC_compare function to detect NULL pointers to cached objects
correctly and also corrected incorrect test in H5AC_flush
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 722b709..5f22c7b 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -311,7 +311,14 @@ H5AC_compare(const void *_a, const void *_b)
assert(current_cache_g);
- if (NULL == current_cache_g->slot[a]->type) {
+ if(NULL==current_cache_g->slot[a]) {
+ if (NULL == current_cache_g->slot[b]) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ else if (NULL == current_cache_g->slot[a]->type) {
if (NULL == current_cache_g->slot[b]->type) {
return 0;
} else {
@@ -412,7 +419,7 @@ H5AC_flush(H5F_t *f, const H5AC_class_t *type, haddr_t addr, hbool_t destroy)
if (NULL == (*info))
continue;
#endif
- if ((*info) || type == (*info)->type) {
+ if (!type || type == (*info)->type) {
flush = (*info)->type->flush;
status = (flush)(f, destroy, (*info)->addr, (*info));
if (status < 0) {