diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-06-06 18:11:10 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-06-06 18:11:10 (GMT) |
commit | f3abf1f3457a879ae698fecce4da16aeb9dc1734 (patch) | |
tree | 1ccb4485abfbf035f2061a7189c601983552837e /src/H5AC.c | |
parent | 4d16bcfecbf51574e3f8bb8cd0e50373892fa462 (diff) | |
download | hdf5-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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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) { |