summaryrefslogtreecommitdiffstats
path: root/src/H5FDint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDint.c')
-rw-r--r--src/H5FDint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 9f02a25..4f3c234 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -120,7 +120,7 @@ H5FD_int_init_interface(void)
herr_t
H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_addr)
{
- haddr_t addr, eoa;
+ haddr_t addr, eoa, eof;
uint8_t buf[H5F_SIGNATURE_LEN];
unsigned n, maxpow;
herr_t ret_value = SUCCEED; /* Return value */
@@ -128,7 +128,10 @@ H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_add
FUNC_ENTER_NOAPI_NOINIT
/* Find the least N such that 2^N is larger than the file size */
- if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER)))
+ eof = H5FD_get_eof(file, H5FD_MEM_SUPER);
+ eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER);
+ addr = MAX(eof, eoa);
+ if(HADDR_UNDEF == addr)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to obtain EOF/EOA value")
for(maxpow = 0; addr; maxpow++)
addr >>= 1;
@@ -348,7 +351,7 @@ done:
*-------------------------------------------------------------------------
*/
haddr_t
-H5FD_get_eof(const H5FD_t *file)
+H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type)
{
haddr_t ret_value;
@@ -358,7 +361,7 @@ H5FD_get_eof(const H5FD_t *file)
/* Dispatch to driver */
if(file->cls->get_eof) {
- if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file)))
+ if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed")
} /* end if */
else