diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-05-14 18:05:43 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-05-14 18:05:43 (GMT) |
commit | 309738c7b004b92fb820683575fd62417c78d544 (patch) | |
tree | 999435ace9e5dd89e7c6d7cd24bfe05de1c9398b /src/H5F.c | |
parent | d7b3f5d35ee223b1180d64cc969f3673587b9134 (diff) | |
download | hdf5-309738c7b004b92fb820683575fd62417c78d544.zip hdf5-309738c7b004b92fb820683575fd62417c78d544.tar.gz hdf5-309738c7b004b92fb820683575fd62417c78d544.tar.bz2 |
[svn-r5414] Purpose:
Bug Fix
Description:
When H5Freopen is called, the file to reopen's 'intent' (read/write
permissions, etc) is not being copied to the new file's 'intent'
information.
Solution:
Copy it. :-)
Platforms tested:
IRIX64 6.5 (modi4)
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -3084,6 +3084,8 @@ H5Funmount(hid_t loc_id, const char *name) * Friday, October 16, 1998 * * Modifications: + * Quincey Koziol, May 14, 2002 + * Keep old file's read/write intent in reopened file. * *------------------------------------------------------------------------- */ @@ -3099,8 +3101,14 @@ H5Freopen(hid_t file_id) if (H5I_FILE!=H5I_get_type(file_id) || NULL==(old_file=H5I_object(file_id))) 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, H5P_DEFAULT, H5P_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file"); + + /* Keep old file's read/write intent in new file */ + new_file->intent=old_file->intent; + if ((ret_value=H5I_register(H5I_FILE, new_file))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle"); |