summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2006-10-25 00:03:34 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2006-10-25 00:03:34 (GMT)
commit8822882ec418af04afd9f671afe2fe0aa1b7c0d9 (patch)
tree4f85e5df7ef1bbbb99a2a75ffb546fe971bd9324
parentb3b05571db49075e8552c58c667392c8e283c345 (diff)
downloadhdf5-8822882ec418af04afd9f671afe2fe0aa1b7c0d9.zip
hdf5-8822882ec418af04afd9f671afe2fe0aa1b7c0d9.tar.gz
hdf5-8822882ec418af04afd9f671afe2fe0aa1b7c0d9.tar.bz2
[svn-r12810] Purpose:
Bug fix. Description: H5FD_get_vfd_handle() would return okay even if an VFD did not have the get_vfd_handle callback function defined. Solution: Return failure if get_vfd_handle function is not defined. Tested: in heping and copper.
-rw-r--r--src/H5FD.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index b9c4382..16051e3 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -3668,7 +3668,9 @@ herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle)
FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL)
assert(file_handle);
- if(file->cls->get_handle && ((ret_value=file->cls->get_handle(file, fapl, file_handle)) < 0))
+ if(NULL==file->cls->get_handle)
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `get_vfd_handle' method");
+ if((ret_value=file->cls->get_handle(file, fapl, file_handle)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver")
done: