diff options
-rw-r--r-- | src/H5Lexternal.c | 13 | ||||
-rw-r--r-- | test/links.c | 2 |
2 files changed, 12 insertions, 3 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; diff --git a/test/links.c b/test/links.c index 1d6b329..2290e69 100644 --- a/test/links.c +++ b/test/links.c @@ -5175,7 +5175,7 @@ main(void) envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) envval = "nomatch"; - if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family") && HDstrcmp(envval, "stdio")) { + if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) { hid_t fapl, fapl2; /* File access property lists */ int nerrors = 0; hbool_t new_format; /* Whether to use the new format or not */ |