Skip to content

Commit

Permalink
Fix H5Pset_vol() failing on non-FAPLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Dec 10, 2024
1 parent b947380 commit 2878de0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/H5Pfapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5829,8 +5829,10 @@ H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info)
FUNC_ENTER_API(FAIL)

/* Check arguments */
if (NULL == (plist = (H5P_genplist_t *)H5P_object_verify(plist_id, H5P_FILE_ACCESS, false)))
if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
if (H5P_is_default_plist(plist_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't change VOL connector on a default property list");
if (NULL == (connector = H5I_object_verify(new_vol_id, H5I_VOL)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file VOL ID");

Expand Down
1 change: 1 addition & 0 deletions src/H5Pprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsig
size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[],
unsigned *filter_config);
H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id);
H5_DLL bool H5P_is_default_plist(hid_t plist_id);

/* Query internal fields of the property list struct */
H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist);
Expand Down

0 comments on commit 2878de0

Please sign in to comment.