diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-02-22 21:40:03 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-02-22 21:40:03 (GMT) |
commit | 19a8216bd52b6a495c4bc989b7d01e9a7ecd46bf (patch) | |
tree | bf07b7366747d1519b628ea1c399bb5e8b654753 /src/H5F.c | |
parent | 7511d8b4691770a15f1ba9f7fcc242f038c79669 (diff) | |
download | hdf5-19a8216bd52b6a495c4bc989b7d01e9a7ecd46bf.zip hdf5-19a8216bd52b6a495c4bc989b7d01e9a7ecd46bf.tar.gz hdf5-19a8216bd52b6a495c4bc989b7d01e9a7ecd46bf.tar.bz2 |
[svn-r29182] Re-commit of HDFFV-8740 fix, which adds the ability to configure
external dataset storage path behavior.
This check-in fixes a bug in the original check-in where the
external path stored in the file struct was not copied on reopen
causing subsequent dataset operations to fail.
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1
autotools serial w/ fortran and C++
autotools parallel (MPICH 3.1.4) w/ fortran
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -785,10 +785,6 @@ done: * Programmer: Robb Matzke * Friday, October 16, 1998 * - * Modifications: - * Quincey Koziol, May 14, 2002 - * Keep old file's read/write intent in reopened file. - * *------------------------------------------------------------------------- */ hid_t @@ -803,26 +799,27 @@ H5Freopen(hid_t file_id) /* Check arguments */ if(NULL == (old_file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Get a new "top level" file struct, sharing the same "low level" file struct */ if(NULL == (new_file = H5F_new(old_file->shared, 0, H5P_FILE_CREATE_DEFAULT, H5P_FILE_ACCESS_DEFAULT, NULL))) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") /* Duplicate old file's names */ new_file->open_name = H5MM_xstrdup(old_file->open_name); new_file->actual_name = H5MM_xstrdup(old_file->actual_name); + new_file->extpath = H5MM_xstrdup(old_file->extpath); if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") /* Keep this ID in file object structure */ new_file->file_id = ret_value; done: if(ret_value < 0 && new_file) - if(H5F_dest(new_file, H5AC_ind_read_dxpl_id, FALSE) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") + if(H5F_dest(new_file, H5AC_ind_read_dxpl_id, FALSE) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") FUNC_LEAVE_API(ret_value) } /* end H5Freopen() */ |