diff options
Diffstat (limited to 'src/H5Oint.c')
-rw-r--r-- | src/H5Oint.c | 27 |
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) { |