diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-24 21:42:38 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-24 21:42:38 (GMT) |
commit | 07a49f439fc44ddec27fd6a25ee0fd52de87ec3c (patch) | |
tree | 09a088c34a092f42fdb4502d3ea25a6f16cc892b /src/H5F.c | |
parent | bfd1c84d5cdc403c1414395cd49197cd4fc74108 (diff) | |
download | hdf5-07a49f439fc44ddec27fd6a25ee0fd52de87ec3c.zip hdf5-07a49f439fc44ddec27fd6a25ee0fd52de87ec3c.tar.gz hdf5-07a49f439fc44ddec27fd6a25ee0fd52de87ec3c.tar.bz2 |
[svn-r24354] Bring revision #24336 from revise_chunks.
h5committested.
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -828,22 +828,25 @@ done: htri_t H5Fis_hdf5(const char *name) { - H5FD_t *file = NULL; /* Low-level file struct */ - htri_t ret_value; /* Return value */ + H5FD_t *file = NULL; /* Low-level file struct */ + haddr_t sig_addr; /* Address of hdf5 file signature */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "*s", name); /* Check args and all the boring stuff. */ if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") /* Open the file at the virtual file layer */ if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF))) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") /* The file is an hdf5 file if the hdf5 file signature can be found */ - ret_value = (HADDR_UNDEF != H5F_locate_signature(file, H5AC_ind_dxpl_id)); + if(H5F_locate_signature(file, H5AC_ind_dxpl_id, &sig_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") + ret_value = (HADDR_UNDEF != sig_addr); done: /* Close the file */ |