summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-11-03 16:16:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-11-03 16:16:25 (GMT)
commit57ad6334c002d7fc6279cc9691301626af8b04ab (patch)
tree0399afa1be1a45d343656f71e4410bcfc08d539b /src/H5Fint.c
parent84787e3085874639ced844666f902297a7b5148b (diff)
downloadhdf5-57ad6334c002d7fc6279cc9691301626af8b04ab.zip
hdf5-57ad6334c002d7fc6279cc9691301626af8b04ab.tar.gz
hdf5-57ad6334c002d7fc6279cc9691301626af8b04ab.tar.bz2
Minor code cleanups.
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c10
1 files changed, 3 insertions, 7 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 */