diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-19 21:14:51 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-19 21:14:51 (GMT) |
commit | 38de07aea3c824e1fc332e7c03c20e1d0711ecb1 (patch) | |
tree | b1e48c62b7df02238c4e281f6a0599fed10fca15 /test/h5test.c | |
parent | 2b4e540fadf6afab13960ae754f4ece5ad4c976a (diff) | |
parent | 33345b835c1cbe96a41c7395ed76af23ea5673d3 (diff) | |
download | hdf5-38de07aea3c824e1fc332e7c03c20e1d0711ecb1.zip hdf5-38de07aea3c824e1fc332e7c03c20e1d0711ecb1.tar.gz hdf5-38de07aea3c824e1fc332e7c03c20e1d0711ecb1.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~jake.smith/hdf5 into dset_ohdr_minimize
Diffstat (limited to 'test/h5test.c')
-rw-r--r-- | test/h5test.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/test/h5test.c b/test/h5test.c index bd56592..e187264 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -763,10 +763,10 @@ h5_rmprefix(const char *filename) * * Purpose: Returns a file access template which is the default template * but with a file driver, VOL connector, or libver bound set - * according to a constant or environment variable + * according to a constant or environment variable * - * Return: Success: A file access property list - * Failure: -1 + * Return: Success: A file access property list + * Failure: H5I_INVALID_HID * * Programmer: Robb Matzke * Thursday, November 19, 1998 @@ -776,24 +776,29 @@ h5_rmprefix(const char *filename) hid_t h5_fileaccess(void) { - hid_t fapl = -1; + hid_t fapl_id = H5I_INVALID_HID; - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - return -1; + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; /* Attempt to set up a file driver first */ - if(h5_get_vfd_fapl(fapl) < 0) - return -1; + if(h5_get_vfd_fapl(fapl_id) < 0) + goto error; /* Next, try to set up a VOL connector */ - if(h5_get_vol_fapl(fapl) < 0) - return -1; + if(h5_get_vol_fapl(fapl_id) < 0) + goto error; /* Finally, check for libver bounds */ - if(h5_get_libver_fapl(fapl) < 0) - return -1; + if(h5_get_libver_fapl(fapl_id) < 0) + goto error; - return(fapl); + return fapl_id; + +error: + if(fapl_id != H5I_INVALID_HID) + H5Pclose(fapl_id); + return H5I_INVALID_HID; } /* end h5_fileaccess() */ @@ -1003,7 +1008,7 @@ error: * fapl but with a VOL connector set according to the constant * or environment variable HDF5_VOL_CONNECTOR. * - * Return: Success: A file access property list ID + * Return: Success: 0 * Failure: -1 * * Programmer: Jordan Henderson |