Skip to content

Commit

Permalink
Fix error return types in H5Rdeprec.c (#4722)
Browse files Browse the repository at this point in the history
Copy-pasted code from elsewhere used FAIL instead of H5G_UNKNOWN
and H5I_INVALID_HID.
  • Loading branch information
derobins authored Aug 16, 2024
1 parent 32ee132 commit 89f62a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/H5Rdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)

/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5G_UNKNOWN,
"can't determine if VOL object is native connector object");
/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5G_UNKNOWN,
"H5Rget_obj_type1 is only meant to be used with the native VOL connector");
/* Get object type */
Expand Down Expand Up @@ -341,12 +341,12 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref)

/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID,
"can't determine if VOL object is native connector object");
/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rdereference1 is only meant to be used with the native VOL connector");
/* Get object type */
Expand Down Expand Up @@ -614,12 +614,12 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *re
/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID,
"can't determine if VOL object is native connector object");

/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rdereference2 is only meant to be used with the native VOL connector");

/* Get object type */
Expand Down Expand Up @@ -694,7 +694,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
"can't query if file uses native VOL connector");
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rget_region is only meant to be used with the native VOL connector");
/* Get object type */
Expand Down

0 comments on commit 89f62a9

Please sign in to comment.