diff options
author | Songyu Lu <songyulu@hdfgroup.org> | 2019-04-17 22:42:01 (GMT) |
---|---|---|
committer | Songyu Lu <songyulu@hdfgroup.org> | 2019-04-17 22:42:01 (GMT) |
commit | b5ef82a1786605ae86502bc82086047720b7d4ca (patch) | |
tree | ce00e05f1cf3cb5bd6ea5d2e54392353b1242e6e /src/H5Defl.c | |
parent | fc47e2e07a252f9421c6d11e88cfd63e5a337183 (diff) | |
download | hdf5-b5ef82a1786605ae86502bc82086047720b7d4ca.zip hdf5-b5ef82a1786605ae86502bc82086047720b7d4ca.tar.gz hdf5-b5ef82a1786605ae86502bc82086047720b7d4ca.tar.bz2 |
Moving the handling of null prefix into H5_combine_path.
Diffstat (limited to 'src/H5Defl.c')
-rw-r--r-- | src/H5Defl.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/H5Defl.c b/src/H5Defl.c index eef758c..91caa61 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -287,13 +287,8 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file") if(H5F_OVERFLOW_HSIZET2OFFT((hsize_t)efl->slot[u].offset + skip)) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") - if(dset->shared->extfile_prefix) { - if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) - HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - } else { - if(H5_combine_path("", efl->slot[u].name, &full_name) < 0) - HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - } + if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) + HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") if((fd = HDopen(full_name, O_RDONLY)) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + (HDoff_t)skip), SEEK_SET) < 0) @@ -384,13 +379,8 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "write past logical end of file") if(H5F_OVERFLOW_HSIZET2OFFT((hsize_t)efl->slot[u].offset + skip)) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") - if(dset->shared->extfile_prefix) { - if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) - HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - } else { - if(H5_combine_path("", efl->slot[u].name, &full_name) < 0) - HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") - } + if(H5_combine_path(dset->shared->extfile_prefix, efl->slot[u].name, &full_name) < 0) + HGOTO_ERROR(H5E_EFL, H5E_NOSPACE, FAIL, "can't build external file name") if((fd = HDopen(full_name, O_CREAT | O_RDWR, H5_POSIX_CREATE_MODE_RW)) < 0) { if(HDaccess(full_name, F_OK) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist") |