summaryrefslogtreecommitdiffstats
path: root/src/H5Oint.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-05-14 17:26:48 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-05-14 17:26:48 (GMT)
commitb178d80be0946e3d332ecf575b2f145837cc9454 (patch)
treea40288aab4c8446a5666c898c51afac2c2daac89 /src/H5Oint.c
parentea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42 (diff)
downloadhdf5-b178d80be0946e3d332ecf575b2f145837cc9454.zip
hdf5-b178d80be0946e3d332ecf575b2f145837cc9454.tar.gz
hdf5-b178d80be0946e3d332ecf575b2f145837cc9454.tar.bz2
Changes made based on feedback from pull request #1039.
Diffstat (limited to 'src/H5Oint.c')
-rw-r--r--src/H5Oint.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 7c5977f..2752a25 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -2243,24 +2243,27 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info_t *oinfo, unsigned fields)
if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header")
+ /* Get class for object */
+ if(NULL == (obj_class = H5O__obj_class_real(oh)))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class")
+
/* Reset the object info structure */
HDmemset(oinfo, 0, sizeof(*oinfo));
- /* Retrieve the file's fileno */
- H5F_GET_FILENO(loc->file, oinfo->fileno);
-
- /* Set the object's address */
- oinfo->addr = loc->addr;
+ /* Get basic information, if requested */
+ if(fields & H5O_INFO_BASIC) {
+ /* Retrieve the file's fileno */
+ H5F_GET_FILENO(loc->file, oinfo->fileno);
- /* Get class for object */
- if(NULL == (obj_class = H5O__obj_class_real(oh)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class")
+ /* Set the object's address */
+ oinfo->addr = loc->addr;
- /* Retrieve the type of the object */
- oinfo->type = obj_class->type;
+ /* Retrieve the type of the object */
+ oinfo->type = obj_class->type;
- /* Set the object's reference count */
- oinfo->rc = oh->nlink;
+ /* Set the object's reference count */
+ oinfo->rc = oh->nlink;
+ }
/* Get time information, if requested */
if(fields & H5O_INFO_TIME) {