diff options
-rw-r--r-- | src/H5Fint.c | 10 | ||||
-rw-r--r-- | src/H5Fsuper.c | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c index 5b7fdda..201dd65 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1041,16 +1041,12 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, * open it are different than the desired flags. Close the tentative * file and open it for real. */ - if(H5FD_close(lf) < 0) { - file = NULL; /*to prevent destruction of wrong file*/ + if(H5FD_close(lf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to close low-level file info") - } /* end if */ - if(NULL == (lf = H5FD_open(name, flags, fapl_id, HADDR_UNDEF))) { - file = NULL; /*to prevent destruction of wrong file*/ + + if(NULL == (lf = H5FD_open(name, flags, fapl_id, HADDR_UNDEF))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") - } /* end if */ } /* end if */ - if(NULL == (file = H5F_new(NULL, flags, fcpl_id, fapl_id, lf))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create new file object") } /* end else */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 23b7f78..5bda9d7 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -401,7 +401,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) * individually. */ /* Can skip this test when it is not the initial file open-- - * H5F_super_read() call from H5F_evict_tagged_metadata() for + * H5F__super_read() call from H5F_evict_tagged_metadata() for * refreshing object. * When flushing file buffers and fractal heap is involved, * the library will allocate actual space for tmp addresses @@ -448,8 +448,7 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) * portion of the driver info block */ if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE) < 0) /* will extend eoa later if required */ - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, \ - "set end of space allocation request failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "set end of space allocation request failed") /* Look up the driver info block */ if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) @@ -458,11 +457,8 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) /* Loading the driver info block is enough to set up the right info */ /* Check if we need to rewrite the driver info block info */ - if ( ( (rw_flags & H5AC__READ_ONLY_FLAG) == 0 ) && - ( H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_DRVRINFO_LOAD) ) ) { - + if(((rw_flags & H5AC__READ_ONLY_FLAG) == 0) && H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_DRVRINFO_LOAD)) drvinfo_flags |= H5AC__DIRTIED_FLAG; - } /* end if */ /* set the pin entry flag so that the driver information block * cache entry will be pinned in the cache. |