summaryrefslogtreecommitdiffstats
path: root/src/H5Fmount.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-07-15 21:23:19 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-07-15 21:23:19 (GMT)
commitd6dadadc7e048436082fa40901fd0f2394064111 (patch)
tree76b378ce385690648f8652e6051a9b7309172a3e /src/H5Fmount.c
parentac73359fb1c766140ffa1b88c4820be56cd01f0a (diff)
downloadhdf5-d6dadadc7e048436082fa40901fd0f2394064111.zip
hdf5-d6dadadc7e048436082fa40901fd0f2394064111.tar.gz
hdf5-d6dadadc7e048436082fa40901fd0f2394064111.tar.bz2
[svn-r15368] Description:
Bring back r15367 from the trunk: Add check to avoid mounting a file on a group twice, when the mounts are done on the same HDF5 file, but opened with separate H5Fopen queries. Also add new 'mounted' flag to the H5G_info_t struct, queried with the H5Gget_info() API call, to allow applications to detect and avoid this situation. Tested on: Mac OS X/32 10.5.4 (amazon) Linux/64 10.5.4 (chicago)
Diffstat (limited to 'src/H5Fmount.c')
-rw-r--r--src/H5Fmount.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 470d323..c96c920 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -135,7 +135,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child,
HDassert(child);
HDassert(TRUE == H5P_isa_class(plist_id, H5P_FILE_MOUNT));
- /* Set up dataset location to fill in */
+ /* Set up group location to fill in */
mp_loc.oloc = &mp_oloc;
mp_loc.path = &mp_path;
H5G_loc_reset(&mp_loc);
@@ -161,6 +161,10 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child,
if(NULL == (mount_point = H5G_open(&mp_loc, dxpl_id)))
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found")
+ /* Check if the proposed mount point group is already a mount point */
+ if(H5G_MOUNTED(mount_point))
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point is already in use")
+
/* Retrieve information from the mount point group */
/* (Some of which we had before but was reset in mp_loc when the group
* "took over" the group location - QAK)