1129
1129
 
 *
1130
1130
 
 * Programmer:  Raymond Lu
1131
1131
 
 *          Nov 20, 2002
1132
1132
 
 *
1133
1133
 
 *-------------------------------------------------------------------------
1134
1134
 
 */
1135
1135
 
static H5G_obj_t
1136
1136
 
H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id)
1137
1137
 
{
1138
1138
 
    H5O_linfo_t linfo;      /* Link info message */
 
1139
+
    htri_t linfo_exists;        /* Whether the link info message exists */
1139
1140
 
    H5G_obj_t ret_value;        /* Return value */
1140
1141
 
1141
1142
 
    FUNC_ENTER_NOAPI(H5G_obj_get_type_by_idx, H5G_UNKNOWN)
1142
1143
 
1143
1144
 
    /* Sanity check */
1144
1145
 
    HDassert(oloc);
1145
1146
 
1146
1147
 
    /* Attempt to get the link info for this group */
1147
 
-
    if(H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) {
 
1148
+
    if((linfo_exists = H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) < 0)
 
1149
+
        HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't check for link info message")
 
1150
+
    if(linfo_exists) {
1148
1151
 
        if(H5F_addr_defined(linfo.fheap_addr)) {
1149
1152
 
            /* Get the object's name from the dense link storage */
1150
1153
 
            if((ret_value = H5G_dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0)
1151
1154
 
                HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
1152
1155
 
        } /* end if */
1153
1156
 
        else {
1154
1157
 
            /* Get the object's type from the link messages */
1155
1158
 
            if((ret_value = H5G_compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0)
1156
1159
 
                HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
1157
1160
 
        } /* end else */
1158
1161
 
    } /* end if */
1159
1162
 
    else {
1160
 
-
        /* Clear error stack from not finding the link info message */
1161
 
-
        H5E_clear_stack(NULL);
1162
 
-
1163
1163
 
        /* Get the object's type from the symbol table */
1164
1164
 
        if((ret_value = H5G_stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0)
1165
1165
 
            HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
1166
1166
 
    } /* end else */
1167
1167
 
1168
1168
 
done:
1169
1169
 
    FUNC_LEAVE_NOAPI(ret_value)
1170
1170
 
} /* end H5G_obj_get_type_by_idx() */
1171
1171
 
#endif /* H5_NO_DEPRECATED_SYMBOLS */
1172
1172