mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
Moving the handling of null prefix into H5_combine_path.
This commit is contained in:
parent
fc47e2e07a
commit
b5ef82a178
18
src/H5Defl.c
18
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")
|
||||
|
@ -1256,13 +1256,13 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/)
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
HDassert(path1);
|
||||
HDassert(path2);
|
||||
|
||||
path1_len = HDstrlen(path1);
|
||||
if(path1)
|
||||
path1_len = HDstrlen(path1);
|
||||
path2_len = HDstrlen(path2);
|
||||
|
||||
if(*path1 == '\0' || H5_CHECK_ABSOLUTE(path2)) {
|
||||
if(path1 == NULL || *path1 == '\0' || H5_CHECK_ABSOLUTE(path2)) {
|
||||
|
||||
/* If path1 is empty or path2 is absolute, simply use path2 */
|
||||
if(NULL == (*full_name = (char *)H5MM_strdup(path2)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user