summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 4bcba32..43d2403 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2367,8 +2367,10 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na
} /* end else */
done:
- if(new_fapl_id > 0 && H5Pclose(new_fapl_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL")
+ /* Close the property list */
+ if(new_fapl_id > 0)
+ if(H5I_dec_app_ref(new_fapl_id) < 0)
+ HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close duplicated FAPL")
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_build_actual_name() */
@@ -2595,16 +2597,15 @@ done:
* david.pitt@bigpond.com
* Apr 27, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Fget_filesize(hid_t file_id, hsize_t *size)
{
- H5F_t *file; /* File object for file ID */
- haddr_t eof; /* End of file address */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File object for file ID */
+ haddr_t eof; /* End of file address */
+ haddr_t base_addr; /* Base address for the file */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", file_id, size);
@@ -2614,10 +2615,12 @@ H5Fget_filesize(hid_t file_id, hsize_t *size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Go get the actual file size */
- if(HADDR_UNDEF == (eof = H5FDget_eof(file->shared->lf)))
+ if(HADDR_UNDEF == (eof = H5FD_get_eof(file->shared->lf)))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
+ base_addr = H5FD_get_base_addr(file->shared->lf);
- *size = (hsize_t)eof;
+ if(size)
+ *size = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */
done:
FUNC_LEAVE_API(ret_value)