summaryrefslogtreecommitdiffstats
path: root/src/H5Lexternal.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-10-04 22:40:06 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-10-04 22:40:06 (GMT)
commit4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a (patch)
tree8f519c0c132d0a6741ac1844368eceec347d7b6f /src/H5Lexternal.c
parent4dea870b6a383f57494af9a729dacf7f00537435 (diff)
downloadhdf5-4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a.zip
hdf5-4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a.tar.gz
hdf5-4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a.tar.bz2
[svn-r12719] Configured external links to (by default) use the FAPL of the parent
file, rather than H5P_DEFAULT. This lets them be used with stdio and directio drivers. Tested on mir and juniper (check-vfd takes a long time!).
Diffstat (limited to 'src/H5Lexternal.c')
-rw-r--r--src/H5Lexternal.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 44ce345..878abfc 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -98,6 +98,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
size_t fname_len;
hbool_t fname_alloc = FALSE;
unsigned intent;
+ hid_t fapl_id;
hid_t ret_value = -1;
file_name = (char *) udata;
@@ -124,17 +125,25 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
HDstrcat(file_name, udata);
}
- /* Figure out if we should open with read-write or read-only */
+ /* Whatever access properties and intent the user used on the old file,
+ * use the same ones to open the new file. If this is a bad default,
+ * users can override this callback using H5Lregister.
+ */
if((fid = H5Iget_file_id(cur_group)) < 0)
goto error;
if(H5Fget_intent(fid, &intent) < 0)
goto error;
+ if((fapl_id = H5Fget_access_plist(fid)) < 0)
+ goto error;
if(H5Fclose(fid) < 0)
goto error;
- if((fid = H5Fopen(file_name, intent, H5P_DEFAULT)) < 0)
+ /* Open the external file */
+ if((fid = H5Fopen(file_name, intent, fapl_id)) < 0)
goto error;
ret_value = H5Oopen(fid, obj_name, lapl_id); /* If this fails, our return value will be negative. */
+ if(H5Pclose(fapl_id) < 0)
+ goto error;
if(H5Fclose(fid) < 0)
goto error;