From 309738c7b004b92fb820683575fd62417c78d544 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 14 May 2002 13:05:43 -0500 Subject: [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) --- src/H5F.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/H5F.c b/src/H5F.c index 4021c22..7943b5e 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -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"); -- cgit v0.12