summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2006-10-25 00:02:56 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2006-10-25 00:02:56 (GMT)
commit2104bb380da40cd8ceae6277a297dd0ed35a618f (patch)
tree66fc27a24fcff792c64de6563990b78b09cc2ffe /src
parent5975624f97d4d8f8075e2afa8cdc1c67c6d224b0 (diff)
downloadhdf5-2104bb380da40cd8ceae6277a297dd0ed35a618f.zip
hdf5-2104bb380da40cd8ceae6277a297dd0ed35a618f.tar.gz
hdf5-2104bb380da40cd8ceae6277a297dd0ed35a618f.tar.bz2
[svn-r12809] 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.
Diffstat (limited to 'src')
-rw-r--r--src/H5FD.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FD.c b/src/H5FD.c
index 952bad9..58e6188 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -3783,8 +3783,10 @@ 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))
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver")
+ 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:
FUNC_LEAVE_NOAPI(ret_value)